Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = hexo => {
const RESERVED_KEYS = {
post: Object.keys(require('hexo/lib/models/post')(hexo).paths),
page: Object.keys(require('hexo/lib/models/page')(hexo).paths)
};
function getThemeConfig(extension) {
if (fs.existsSync(path.join(hexo.theme_dir, '_config' + extension + '.yml'))) {
return yaml.safeLoad(fs.readFileSync(path.join(hexo.theme_dir, '_config' + extension + '.yml')));
}
return null;
}
const ALTERNATIVE_CONFIG = {
post: getThemeConfig('.post'),
page: getThemeConfig('.page')
}
function getExtraConfig(source, reservedKeys) {
const result = {};