summaryrefslogtreecommitdiff
path: root/themes/hugo-book/layouts/shortcodes/mermaid.html
blob: 07a3bfc0eaaa447fc23a50551d2da3661b739c27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time -->
<script src="{{ "mermaid.min.js" | relURL }}"></script>
{{ with resources.Get "mermaid.json" }}
  <script>mermaid.initialize({{ .Content | safeJS }})</script>
{{ end }}
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}

<pre class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
  {{- .Inner -}}
</pre>
Directive (EU) 2019/790, Article 4(3); all rights regarding Text and Data Mining (TDM) are reserved.