portails/layouts/shortcodes/mermaid.html

8 lines
300 B
HTML

{{ if .Site.Params.options.mermaid -}}
<div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{ $data := replaceRE "(^\\s+```)" "" .Inner -}}
{{ replaceRE "(```\\s+$)" "" $data -}}
</div>
{{ else }}
{{ errorf "Set `mermaid = true` in `./config/_default/params.toml`"}}
{{ end }}