Choose a thumbnail from the photos of the post without thumbnail and banner

Signed-off-by: Xiaofeng QU <xiaofeng.qu.hk@ieee.org>
This commit is contained in:
Xiaofeng QU 2015-07-06 11:54:55 +08:00
parent e7a195e442
commit 9ca2ed1133
1 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,8 @@
s = post.thumbnail;
}else if (post.banner){
s = post.banner;
}else if (post.photos && post.photos.length){
s = post.photos[0];
}else{
var img=/\<img\s.*?\s?src\s*=\s*['|"]?([^\s'"]+).*?\>/ig;
var result = post.content.match(img);