diff --git a/layout/_partial/main/post_list/post_card.ejs b/layout/_partial/main/post_list/post_card.ejs
index 416e4fc..0f1c01f 100755
--- a/layout/_partial/main/post_list/post_card.ejs
+++ b/layout/_partial/main/post_list/post_card.ejs
@@ -2,6 +2,38 @@
function div_default() {
var el = '';
el += '';
+
+ // 封面
+ if (post.cover || theme.article.auto_cover) {
+ var cover_url;
+ if (post.cover != undefined) {
+ if (post.cover.includes('/')) {
+ cover_url = post.cover;
+ } else {
+ cover_url = 'https://source.unsplash.com/1280x640/?' + post.cover;
+ }
+ } else {
+ // 自动以 tags 作为关键词搜索封面
+ if (post.tags) {
+ var params = '';
+ post.tags.reverse().forEach((tag, i) => {
+ if (i > 0) {
+ params += ',';
+ }
+ params += tag.name;
+ });
+ cover_url = 'https://source.unsplash.com/1280x640/?' + params;
+ } else {
+ cover_url = 'https://source.unsplash.com/random/1280x640';
+ }
+ }
+ if (cover_url) {
+ el += '';
+ el += '
';
+ el += '
';
+ }
+ }
+
// 标题
el += '';
el += (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, config.date_format);
@@ -43,10 +75,10 @@ function div_default() {
}
}
}
- el += '';
if (post.pin) {
el += '';
}
+ el += '';
el += '
';
return el;
}
@@ -54,22 +86,30 @@ function div_photo() {
var el = '';
el += '
';
+ } else {
+ el += 'position="bottom">';
+ }
+ if (post.cover_info.meta) {
+ el += '
' + post.cover_info.meta + '
';
+ }
+ if (post.cover_info.title) {
+ el += '
' + post.cover_info.title + '
';
+ }
+ if (post.cover_info.subtitle) {
+ el += '
' + post.cover_info.subtitle + '
';
+ }
+ el += '
';
- el += '