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

This commit is contained in:
XPoet 2020-04-18 17:35:04 +08:00
parent 7a93270b46
commit 807feaa99c
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
hexo.on('generateBefore', function () {
const rootConfig = hexo.config;
if (hexo.locals.get) {
const data = hexo.locals.get('data');
if (data && data._config) {
hexo.theme.config = data._config;
}
}
hexo.theme.config.rootConfig = rootConfig;
});