diff --git a/scripts/use-source-data.js b/scripts/use-source-data.js new file mode 100644 index 0000000..7d48be3 --- /dev/null +++ b/scripts/use-source-data.js @@ -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; +}); \ No newline at end of file