add disable animation, mermaid support

Signed-off-by: GitHub Action <action@github.com>
This commit is contained in:
GitHub Action
2024-10-23 17:21:35 +00:00
parent 08494a1088
commit cdef5afeed
6 changed files with 17 additions and 11 deletions

View File

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

View File

@ -46,12 +46,7 @@
<script defer src="{{ $c_js.Permalink }}" {{ printf "integrity=%q" $c_js.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{- end }}
{{- partial "mathjax.html" . -}}
{{ if .Page.Store.Get "hasMermaid" }}
<script defer type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true,theme: 'dark' });
</script>
{{ end }}
{{- partial "mermaid.html" . -}}
{{- if templates.Exists "partials/extra-foot.html" -}}{{- partial "extra-foot.html" . -}}{{- end }}
</body>

View File

@ -0,0 +1,6 @@
{{- if .Page.Store.Get "hasMermaid" -}}
<script defer async type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true,theme: 'dark' });
</script>
{{- end -}}