Hexo博客搭建中遇到的问题及解决方法


  • 公式渲染问题
npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-kramed --save

找到node_modules\kramed\lib\rules\inline.js这个文件,修改对应位置:

//  escape: /^\\([\\`*{}\[\]()#$+\-.!_>])/,
  escape: /^\\([`*\[\]()#$+\-.!_>])/
  
//  em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
  em: /^\*((?:\*\*|[\s\S])+?)\*(?!\*)/

修改配置文件:

# MathJax Support
mathjax:
  enable: true
  per_page: true
  • 一级标题无法点击

在经过一天的排查后,发现是我的公式里面的{% label \frac purple %}导致的。不知道为啥,调了几次就OK了。

排除到最后,我猜测是这两个文件的问题:

image-20211221113335459

我也不敢{% label hexo-clean purple %}了。


💌lixiang117423@foxmail.com
💌lixiang117423@gmail.com


Author: 小蓝哥
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source 小蓝哥 !
  TOC