趁着博客整合,修理一下mermaid不支持的问题。
从网上找到了一些教程,但是配置过程中也发现了一些问题,所以在这里记录一下。
一、安装
安装插件:
1 | npm install hexo-filter-mermaid-diagrams |
添加配置。在主题目录下的_config.yml
文件中新增配置:
1 | # mermaid chart |
添加支持。我使用的BuleLake主题js
后缀是.ejs
(其它类型(.pug
、.swig
)参考Github说明),在themes\bluelake\layout\_partial\
**after-footer.ejs
**中添加如下内容
1 | <% if (theme.mermaid.enable) { %> |
二、使用
主题类型:(在上面修改文件时配置):
- default - This is the default theme for all diagrams.
- neutral - This theme is great for black and white documents that will be printed.
- dark - This theme goes well with dark-colored elements or dark-mode.
- forest - This theme contains shades of green.
- base - This is the only theme that can be modified. Use this theme as the base for customizations.
三、注意
- mermaid新增配置是修改的主题目录下的文件
- 需要将根目录配置
_config.yml
中highlight
下的auto_detect
设置为true
原文链接: https://www.delta1037.cn/2023/Deploy/hexo新增mermaid支持/
版权声明: 转载请注明出处.