{{- /* remove whitespaces */ -}}
<pre class="mermaid">{{ .Inner | htmlEscape | safeHTML -}}</pre>
{{- if not (.Page.Store.Get "mermaid") -}}
  {{- /* Include mermaid only first time */ -}}
  <script src="{{ "mermaid.min.js" | relURL }}"></script>
  {{- with resources.Get "mermaid.json" | minify -}}
    <script>mermaid.initialize({{ .Content | safeJS }})</script>
  {{- end -}}
  {{- .Page.Store.Set "mermaid" true -}}
{{- end -}}