summaryrefslogtreecommitdiff
path: root/themes/hugo-book/layouts/_shortcodes/mermaid.html
blob: 078d7d3763a1ce2e6c533845fab37b1b82be19e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{{ if not (.Page.Store.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.Store.Set "mermaid" true }}
{{ end }}

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