hexo的yelee主题使用katex引擎(markdown渲染加速)
關(guān)于hexo網(wǎng)上的絕大部分對(duì)markdown語(yǔ)法進(jìn)行渲染的都是mathjax引擎,
但是mathjax實(shí)在是響應(yīng)太慢了。
后來(lái)看到了鏈接[1],是針對(duì)next主題的,下載了一個(gè)next主題研究了下,發(fā)現(xiàn)主題里面并沒有katex相關(guān)的東西,于是猜測(cè)一定程度上,katex無(wú)視主題。
下面說(shuō)下在yelee主題[2]上的處理步驟:
npm install hexo-math --save
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save
?站點(diǎn)根目錄下面的_config.yml:
math:engine: katexkatex:css: https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.cssjs: https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.jsconfig:# KaTeX configthrowOnError: falseerrorColor: "#cc0000"?
yelee主題下面的_config.yml
# Math Equations Render Support math:enable: trueper_page: false#engine: mathjaxengine: katexkatex:# Use 0.7.1 as default, jsdelivr as default CDN, works everywhere even in Chinacdn: //cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css#cdn: //cdn.jsdelivr.net/npm/katex@0.7.1/dist/katex.min.css# CDNJS, provided by cloudflare, maybe the best CDN, but not works in China#cdn: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.csscopy_tex:# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-texenable: truecopy_tex_js: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.jscopy_tex_css: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css?
hexo clean && hexo g && gulp && hexo d
(gulp是用來(lái)給hexo整體進(jìn)行加速的,沒安裝和配置過gulp的可以去掉這個(gè)命令)
預(yù)覽效果是:
https://appleyuchi.github.io/2019/06/12/A-new-post/
?
[1]https://jun-wang-2018.github.io/MyBlog/en/hexo-and-katex/
[2]https://github.com/leikelin/hexo-theme-yelee
總結(jié)
以上是生活随笔為你收集整理的hexo的yelee主题使用katex引擎(markdown渲染加速)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: gulp加速hexo的yelee主题
- 下一篇: hexo博客完整备份