blinkfox / hexo-theme-matery

A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
https://blinkfox.github.io/
Apache License 2.0
5.24k stars 1.25k forks source link

hexo7.1.1代码显示问题 #910

Open YiJieLiuHub opened 8 months ago

YiJieLiuHub commented 8 months ago

image 配置如下:

syntax_highlighter: prismjs
highlight:
  auto_detect: false
  line_number: true
  line_threshold: 0
  tab_replace: ''
  exclude_languages:
    - example
  wrap: true
  hljs: false
prismjs:
  preprocess: true
  line_number: true
  line_threshold: 0
  tab_replace: ''
YiJieLiuHub commented 8 months ago

以上问题已经解决,但是渲染不了Vue代码 image

yanhuacuo commented 8 months ago

目前看,只能降级

yanhuacuo commented 8 months ago

prism.zip

解决办法

博客根目录中使用新参数

根目录的 _config.yaml 中:

syntax_highlighter: prismjs
highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: true
  preprocess: true
  line_number: true
  tab_replace: ''

添加 prismjs.css

在目录 hexo-theme-matery\source\libs\prism 下,添加:prism.css

分享:

prism.zip

yanhuacuo commented 8 months ago

勾选多种语言或全选,我上面分享的压缩包就是选了支持全部语言特性的

sustcsugar commented 1 month ago

你们会有代码折行的问题吗? 我博客的代码会自动换行, 主题里面yml的设置不管用。