hexo的yelee主题使用katex引擎(markdown渲染加速)
生活随笔
收集整理的這篇文章主要介紹了
hexo的yelee主题使用katex引擎(markdown渲染加速)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
關于hexo網上的絕大部分對markdown語法進行渲染的都是mathjax引擎,
但是mathjax實在是響應太慢了。
后來看到了鏈接[1],是針對next主題的,下載了一個next主題研究了下,發現主題里面并沒有katex相關的東西,于是猜測一定程度上,katex無視主題。
下面說下在yelee主題[2]上的處理步驟:
npm install hexo-math --save
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save
?站點根目錄下面的_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是用來給hexo整體進行加速的,沒安裝和配置過gulp的可以去掉這個命令)
預覽效果是:
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
總結
以上是生活随笔為你收集整理的hexo的yelee主题使用katex引擎(markdown渲染加速)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: gulp加速hexo的yelee主题
- 下一篇: hexo博客完整备份