Update: archive 归档页面年份较大排前面

This commit is contained in:
XPoet 2020-03-27 20:49:27 +08:00
parent b6cd295afe
commit 33e1f2fc06
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ hexo.extend.helper.register('isInHomePaging', function (pagePath, route) {
hexo.extend.helper.register('createNewArchivePosts', function (posts) { hexo.extend.helper.register('createNewArchivePosts', function (posts) {
const postList = [], postYearList = []; const postList = [], postYearList = [];
posts.forEach(post => postYearList.push(post.date.year())); posts.forEach(post => postYearList.push(post.date.year()));
Array.from(new Set(postYearList)).forEach(year => { Array.from(new Set(postYearList)).reverse().forEach(year => {
postList.push({ postList.push({
year: year, year: year,
postList: [] postList: []