hexo-theme-butterfly/scripts/replace-config.js
hwy0127@gmail.com 5a3363e0e4 fix bugs
2019-06-17 21:25:18 +08:00

12 lines
348 B
JavaScript

/**
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
*/
hexo.on('generateBefore', function () {
const rootConfig = hexo.config
if (hexo.locals.get) {
const data = hexo.locals.get('data')
data && data.butterfly && (hexo.theme.config = data.butterfly)
}
hexo.theme.config.rootConfig = rootConfig
})