diff --git a/_config.yml b/_config.yml index 5571848..a8c62e6 100644 --- a/_config.yml +++ b/_config.yml @@ -20,6 +20,7 @@ page: right_side_width: 70 media_max_width: 960 + # Social Links. # Usage: `Key: permalink || icon` # Key is the link label showing to end users. @@ -43,6 +44,7 @@ social: # https://github.com/chriskempson/tomorrow-theme highlight_theme: normal + # Valine. # You can get your appid and appkey from https://leancloud.cn # more info please open https://github.com/xCss/Valine diff --git a/scripts/helpers/helper.js b/scripts/helpers/helper.js index 5e23245..6cc5835 100644 --- a/scripts/helpers/helper.js +++ b/scripts/helpers/helper.js @@ -9,12 +9,13 @@ hexo.extend.helper.register('isInHomePaging', function (pagePath, route) { hexo.extend.helper.register('createNewArchivePosts', function (posts) { const postList = [], postYearList = []; posts.forEach(post => postYearList.push(post.date.year())); - Array.from(new Set(postYearList)).reverse().forEach(year => { + Array.from(new Set(postYearList)).forEach(year => { postList.push({ year: year, postList: [] }) }); + postList.sort((a, b) => b.year - a.year); postList.forEach(item => { posts.forEach(post => item.year === post.date.year() && item.postList.push(post)) });