Added support for ```mermaid

This commit is contained in:
CharlesPhilippeLabbe 2025-06-06 15:57:00 -04:00
parent f2c703e155
commit 25c454d5c8
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<pre class="mermaid">
{{ .Inner | htmlEscape | safeHTML }}
</pre>
{{ .Page.Store.Set "hasMermaid" true }}

View File

@ -81,3 +81,9 @@
{{ define "toc" }} {{ define "toc" }}
{{ partial "docs/toc" . }} {{ partial "docs/toc" . }}
{{ end }} {{ end }}
{{ if .Store.Get "hasMermaid" }}
<script type="module">
import mermaid from 'mermaid.min.js';
mermaid.initialize({ startOnLoad: true });
</script>
{{ end }}