Added mermaid support

This commit is contained in:
John Wellbelove 2026-10-26 23:30:44 +00:00
parent 2aa0c4edb3
commit 74634a54fb
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 }}

6
hugo/layouts/baseof.html Normal file
View File

@ -0,0 +1,6 @@
{{ 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 }}