hexo-theme-ayer/scripts/events/lib/merge-configs.js

25 lines
543 B
JavaScript
Raw Normal View History

2021-05-24 03:28:56 +00:00
"use strict";
const objUtil = require("../../utils/object");
const { isNotEmptyObject } = require("../../utils/object");
module.exports = (hexo) => {
2023-03-19 16:07:30 +00:00
2021-05-24 03:28:56 +00:00
if (isNotEmptyObject(hexo.config.theme_config)) {
hexo.theme.config = objUtil.merge(
{},
hexo.theme.config,
hexo.config.theme_config
);
hexo.log.info(
"[Ayer] Merge theme config from theme_config in _config.yml"
);
}
}
hexo.log.debug(
"[Ayer] Output theme config:\n",
JSON.stringify(hexo.theme.config, undefined, 2)
);
};