Update: archive 归档页面年份较大排前面
This commit is contained in:
parent
b6cd295afe
commit
33e1f2fc06
|
@ -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: []
|
||||||
|
|
Loading…
Reference in New Issue