[opt] post.pin -> post.sticky
This commit is contained in:
parent
ef58c7081b
commit
f53a89f324
|
@ -90,7 +90,7 @@ function div_default() {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (post.pin) {
|
||||
if (post.sticky) {
|
||||
el += `<span class="pin">${icon('default:pin')}</span>`
|
||||
}
|
||||
el += '</div>';
|
||||
|
|
|
@ -21,25 +21,9 @@ function layout_post_card(layout, post, content) {
|
|||
function layout_post_list(partial) {
|
||||
var el = '';
|
||||
el += '<div class="post-list post">';
|
||||
if (is_home()) {
|
||||
// pinned posts
|
||||
if (page.current == 1) {
|
||||
var pinned = site.posts.filter(post => post.pin != undefined).sort((config.index_generator && config.index_generator.order_by) || '-date');
|
||||
pinned.forEach((post, i) => {
|
||||
el += layout_post_card('post', post, partial(post));
|
||||
});
|
||||
}
|
||||
// unpinned posts
|
||||
page.posts.each(function(post){
|
||||
if (post.pin == undefined) {
|
||||
el += layout_post_card('post', post, partial(post));
|
||||
}
|
||||
})
|
||||
} else {
|
||||
page.posts.each(function(post){
|
||||
el += layout_post_card('post', post, partial(post));
|
||||
})
|
||||
}
|
||||
el += '</div>';
|
||||
return el;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue