datalad-blog/layouts/_markup/render-codeblock-mermaid.html
Jiameng Wu 3950f9c341 Add client-side mermaid diagram rendering with local vendoring
Use a Hugo render hook to convert mermaid code blocks into <pre> tags,
and a client-side check to dynamically load the vendored mermaid.min.js
only on pages that contain mermaid diagrams. The library is vendored
locally via vendor-mermaid.sh (to be run with datalad run) instead of
loaded from a CDN, so the site does not depend on external services.
2026-04-08 12:40:14 +02:00

4 lines
110 B
HTML

<pre class="mermaid">
{{- .Inner | htmlEscape | safeHTML }}
</pre>
{{- .Page.Store.Set "hasMermaid" true }}