From 7a93270b46a3114aa662be9d011ef4bd9495380c Mon Sep 17 00:00:00 2001 From: XPoet Date: Sat, 18 Apr 2020 17:33:11 +0800 Subject: [PATCH] feat: overwrite _config.yml using _config.yml in folder source/_data --- scripts/helpers/export-config.js | 25 +++++++++++++------------ scripts/helpers/helper.js | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/helpers/export-config.js b/scripts/helpers/export-config.js index ebb8598..c8af5bc 100644 --- a/scripts/helpers/export-config.js +++ b/scripts/helpers/export-config.js @@ -7,18 +7,19 @@ const url = require('url'); /** * Export theme config to js */ -hexo.extend.helper.register('export_config', function() { - let { config, theme } = this; - let exportConfig = { - hostname : url.parse(config.url).hostname || config.url, - root : config.root, - localsearch: theme.local_search, - themeInfo: theme.theme_info - }; - if (config.search) { - exportConfig.path = config.search.path; - } - return ``; }); diff --git a/scripts/helpers/helper.js b/scripts/helpers/helper.js index 6cc5835..0e900cb 100644 --- a/scripts/helpers/helper.js +++ b/scripts/helpers/helper.js @@ -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)) });