mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Adapt to Hexo 7 highlight settings
This commit is contained in:
parent
c8c2fb23e5
commit
269eae34c4
@ -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')
|
||||
|
||||
@ -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}'),
|
||||
|
||||
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user