~mrls/essential

essential/layouts/shortcodes/mermaid.html -rw-r--r-- 495 bytes
27db479cMauro Morales Add pic archetypes 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time -->
<script defer src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
    document.addEventListener("DOMContentLoaded", function(event) {
        mermaid.initialize({startOnLoad:true});
    });
</script>
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}

<div class="mermaid-container">
  <div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
    {{- .Inner -}}
  </div>
</div>