Hexo Mermaid 插件
Step1 Install Package
1 | $ yarn add hexo-filter-mermaid-diagrams |
In your blog floder, not hexo floder
Step2 Edit Config
After installed, you should edit hexo config file: _config.yml:
1 | # mermaid chart |
❗️❗️❗️Notice: if you want to use ‘Class diagram’, please edit your ‘_config.yml’ file, set
external_link: false. - hexo bug.
Step3 include mermaid.js in pug or ejs
After edited _config.yml, you shou edit your blog page component like after_footer.pug , after-footer.ejs or swig.
Where is it?
Open your theme folder, you can see the layout folder, open it and then you could see it.
Okey! if your blog is used pug, you can copy the below codes in after_footer.pug:
1 | if theme.mermaid.enable == true |
after-footer.ejs should copy below codes:
1 | <% if (theme.mermaid.enable) { %> |
swig template engine:
1 | {% if theme.mermaid.enable %} |