Skip to content

Commit

Permalink
Adapt to Hexo 7 highlight settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Dec 17, 2023
1 parent c8c2fb2 commit 269eae3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/events/lib/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module.exports = hexo => {
config.highlight.hljs = false;
config.prismjs = config.prismjs || {};
theme.highlight = {
enable: config.highlight.enable && !config.prismjs.enable,
enable: config.syntax_highlighter === 'highlight.js' || config.highlight.enable,
light : highlightTheme(theme.codeblock.theme.light),
dark : highlightTheme(theme.codeblock.theme.dark)
};
theme.prism = {
enable: config.prismjs.enable,
enable: config.syntax_highlighter === 'prismjs' || config.prismjs.enable,
light : prismTheme(theme.codeblock.prism.light),
dark : prismTheme(theme.codeblock.prism.dark),
number: resolve('prismjs', 'plugins/line-numbers/prism-line-numbers.css')
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/next-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ hexo.extend.helper.register('next_config', function() {
comments : theme.comments,
stickytabs: theme.tabs.sticky,
motion : theme.motion,
prism : config.prismjs.enable && !config.prismjs.preprocess,
prism : theme.prism.enable && !config.prismjs.preprocess,
i18n : {
placeholder: __('search.placeholder'),
empty : __('search.empty', '${query}'),
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/next-vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
hexo.extend.helper.register('js_vendors', function() {
const { config, theme } = this;
const vendors = ['anime'];
if (config.prismjs.enable && !config.prismjs.preprocess) {
if (theme.prism.enable && !config.prismjs.preprocess) {
vendors.push('prism', 'prism_autoloader');
if (config.prismjs.line_number) {
vendors.push('prism_line_numbers');
Expand Down

0 comments on commit 269eae3

Please sign in to comment.