2020-04-18 17:35:04 +08:00
|
|
|
hexo.on('generateBefore', function () {
|
2020-11-26 16:09:09 +08:00
|
|
|
if (hexo.locals.get) {
|
2022-09-30 11:40:30 +08:00
|
|
|
const data = hexo.locals.get('data')
|
2020-11-26 16:09:09 +08:00
|
|
|
|
|
|
|
if (data) {
|
|
|
|
// theme config file handle
|
|
|
|
if (data._config) {
|
2022-09-30 11:40:30 +08:00
|
|
|
hexo.theme.config = data._config
|
2020-11-26 16:09:09 +08:00
|
|
|
} else if (data.keep) {
|
2022-09-30 11:40:30 +08:00
|
|
|
hexo.theme.config = data.keep
|
2020-11-26 16:09:09 +08:00
|
|
|
} else if (data._keep) {
|
2022-09-30 11:40:30 +08:00
|
|
|
hexo.theme.config = data._keep
|
2020-11-26 16:09:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// friends link file handle
|
|
|
|
if (data.links || data.link) {
|
2022-09-30 11:40:30 +08:00
|
|
|
hexo.theme.config.links = data.links || data.link
|
2020-11-26 16:09:09 +08:00
|
|
|
}
|
2020-04-18 17:35:04 +08:00
|
|
|
}
|
2020-11-26 16:09:09 +08:00
|
|
|
}
|
2022-09-30 11:40:30 +08:00
|
|
|
})
|