aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes/mermaid.html
blob: 9a9436f612040d288f4a8dad5a0176f658f05a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time -->
<script src="{{ "mermaid.min.js" | relURL }}"></script>
<script>
mermaid.initialize({
  flowchart: { useMaxWidth:true }
});
</script>
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}

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