Hexo个人博客
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
784 B

/**
* Stylus renderer
*/
'use strict'
hexo.extend.filter.register('stylus:renderer', style => {
const { syntax_highlighter: syntaxHighlighter, highlight, prismjs } = hexo.config
let { enable: highlightEnable, line_number: highlightLineNumber } = highlight
let { enable: prismjsEnable, line_number: prismjsLineNumber } = prismjs
// for hexo > 7.0
if (syntaxHighlighter) {
highlightEnable = syntaxHighlighter === 'highlight.js'
prismjsEnable = syntaxHighlighter === 'prismjs'
}
style.define('$highlight_enable', highlightEnable)
.define('$highlight_line_number', highlightLineNumber)
.define('$prismjs_enable', prismjsEnable)
.define('$prismjs_line_number', prismjsLineNumber)
// .import(`${this.source_dir.replace(/\\/g, '/')}_data/css/*`)
})