LoveIt/layouts/shortcodes/mermaid.html

11 lines
433 B
HTML
Raw Normal View History

<!-- shuffle md5 as id -->
2020-01-31 15:53:04 +01:00
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "mermaid-%s" -}}
{{- $mermaidMap := .Page.Scratch.Get "mermaidMap" -}}
{{- if $mermaidMap -}}
{{- $mermaidMap = trim .Inner "\n" | dict $id | merge $mermaidMap -}}
{{- else -}}
{{- $mermaidMap = trim .Inner "\n" | dict $id -}}
{{- end -}}
{{- .Page.Scratch.Set "mermaidMap" $mermaidMap -}}
2020-02-06 17:10:00 +01:00
<div class="mermaid" id="{{ $id }}"></div>