Skip to content

Commit

Permalink
⚡ 适配 Hexo v7.0.0 配置变动 #1020
Browse files Browse the repository at this point in the history
  • Loading branch information
zkqiang committed Nov 27, 2023
1 parent 9164884 commit 48303c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/events/lib/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = (hexo) => {
auto_detect: true,
line_number: config.code.highlight.line_number || false
});
hexo.config.syntax_highlighter = 'highlight.js'; // hexo v7.0.0+ config
hexo.theme.config.code.highlight.highlightjs = objUtil.merge({}, hexo.theme.config.code.highlight.highlightjs, {
light: resolveHighlight(hexo.theme.config.code.highlight.highlightjs.style),
dark : hexo.theme.config.dark_mode.enable && resolveHighlight(hexo.theme.config.code.highlight.highlightjs.style_dark)
Expand Down Expand Up @@ -124,6 +125,7 @@ module.exports = (hexo) => {
preprocess : config.code.highlight.prismjs.preprocess || false,
line_number: config.code.highlight.line_number || false
});
hexo.config.syntax_highlighter = 'prismjs'; // hexo v7.0.0+ config
hexo.theme.config.code.highlight.prismjs = objUtil.merge({}, hexo.theme.config.code.highlight.prismjs, {
light: resolvePrism(hexo.theme.config.code.highlight.prismjs.style),
dark : hexo.theme.config.dark_mode.enable && resolvePrism(hexo.theme.config.code.highlight.prismjs.style_dark)
Expand Down

0 comments on commit 48303c8

Please sign in to comment.