feat: add support for mermaid diagrams (#244)
parent
66f3e249fe
commit
5f3d430699
@ -0,0 +1,4 @@
|
|||||||
|
<div class="mermaid">
|
||||||
|
{{- .Inner | safeHTML }}
|
||||||
|
</div>
|
||||||
|
{{ .Page.Store.Set "hasMermaid" true }}
|
@ -0,0 +1,8 @@
|
|||||||
|
{{if $.Site.Data.config.enableMermaid}}
|
||||||
|
{{ if .Page.Store.Get "hasMermaid" }}
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from 'https://unpkg.com/mermaid@9/dist/mermaid.esm.min.mjs';
|
||||||
|
mermaid.initialize({ startOnLoad: true });
|
||||||
|
</script>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
Loading…
Reference in New Issue