add: mermaid support
This commit is contained in:
parent
775f4e9de0
commit
ce5f1811c4
4 changed files with 122 additions and 2 deletions
|
@ -41,4 +41,15 @@
|
|||
{{ if not .Params.disableComments }}
|
||||
{{ partial "comments.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{/* When you use ```mermaid``, render-codeblock-mermaid.html is called and
|
||||
`.Store.Set "hasMermaid"` is executed.
|
||||
`.Store.Get "hasMermaid"` will return true and mermaid.js will be loaded.
|
||||
*/}}
|
||||
{{ if .Store.Get "hasMermaid" }}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue