Add mermaid into github pages
To render beautiful graphs, sequence and Gantt diagrams and flowcharts via code, we can use the Mermaid library.
Jekyll has a plugin to to simplify the creation of mermaid diagrams and flowcharts in your posts and pages.
However, for safety reasons, if you want github automatically transform your post into web pages, you can’t use a plugin.
We will make mermaid work on github pages without plugin.
Dowload release version of Mermaid.
Make a dir in your github pages project, such as
Copy all files in mermaid/dist folder to your
Open your github pages project
/layout/post.html, add following code:
You can also change
Everything done, you can use mermaid graphs in your posts now:
Then you would see:
Embed Mermaid Charts in Jekyll without Plugin