[fix] recent sort
This commit is contained in:
parent
977d3264b8
commit
7e2fa31b62
|
@ -20,11 +20,12 @@ function layoutDiv() {
|
|||
}
|
||||
return false
|
||||
})
|
||||
arr = arr.sort((p1, p2) => p1.updated > p2.updated ? -1 : 1)
|
||||
} else {
|
||||
arr = site.posts.filter( p => p.title && p.title.length > 0)
|
||||
arr = arr.sort("updated", -1)
|
||||
}
|
||||
el += '<div class="widget-body related-posts fs14">';
|
||||
arr = arr.sort((p1, p2) => p1.order > p2.order ? -1 : 1)
|
||||
arr.length = item.limit
|
||||
arr.forEach(post => {
|
||||
el += '<a class="item title" href="' + url_for(post.link || post.path) + '">';
|
||||
|
|
|
@ -13,6 +13,7 @@ class WikiPage {
|
|||
this.seo_title = page.seo_title
|
||||
this.wiki = page.wiki
|
||||
this.order = page.order || 0
|
||||
this.updated = page.updated
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue