feat: overwrite _config.yml using _config.yml in folder source/_data

This commit is contained in:
XPoet 2020-04-18 17:33:11 +08:00
parent 5ec1f7c8fb
commit 7a93270b46
2 changed files with 14 additions and 13 deletions

View File

@ -13,7 +13,8 @@ hexo.extend.helper.register('export_config', function() {
hostname: url.parse(config.url).hostname || config.url,
root: config.root,
localsearch: theme.local_search,
themeInfo: theme.theme_info
themeInfo: theme.theme_info,
codeblock: theme.codeblock
};
if (config.search) {
exportConfig.path = config.search.path;

View File

@ -15,7 +15,7 @@ hexo.extend.helper.register('createNewArchivePosts', function (posts) {
postList: []
})
});
postList.sort((a, b) => b.year - a.year);
postList.sort((a, b) => b.year - a.year)
postList.forEach(item => {
posts.forEach(post => item.year === post.date.year() && item.postList.push(post))
});