hexo-theme-butterfly/scripts/replace-config.js
2019-06-04 22:37:36 +08:00

12 lines
339 B
JavaScript

/**
* Note: configs in _data/melody.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.melody && (hexo.theme.config = data.melody)
}
hexo.theme.config.rootConfig = rootConfig
})