Add shortcode for mermaid diagrams

This commit is contained in:
ItsDrike 2022-05-23 18:54:27 +02:00
parent 2eec248847
commit d3f9af4560
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -0,0 +1,9 @@
{{ $mermaidData := dict "theme" "default" }}
{{ $data := dict "code" .Inner "mermaid" $mermaidData }}
<figure class="mermaid">
<img src="https://mermaid.ink/img/{{ $data | jsonify | base64Encode }}" referrerpolicy="no-referrer">
<figcaption class="text-center">
<small>{{ .Get "caption" }}</small>
</figcaption>
</figure>