对Hexo添加mermaid支持
本篇博客是关于在hexo中添加配置mermaid的记录
安装Mermaid插件
在博客文件夹运行命令:
1 | npm install hexo-filter-mermaid-diagrams --save |
修改配置文件
在路径theme/next(主题文件夹)下找到配置文件
在其中找到mermaid相关代码段并修改:
1 | # Mermaid tag |
测试
1 | graph TD; |
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
1 | sequenceDiagram |
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts
prevail...
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!