hexo-theme-keep/scripts/use-source-data.js

10 lines
297 B
JavaScript

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;
});