portails/layouts/shortcodes/mermaid.html

9 lines
333 B
HTML

{{ if .Page.Params.mermaid -}}
<div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{ $data := replaceRE "(^\\s+```)" "" .Inner -}}
{{ replaceRE "(```\\s+$)" "" $data -}}
</div>
{{ else -}}
{{ errorf "Failed to process mermaid shortcode: %s. Set mermaid to true in page front matter." .Position }}
{{ end -}}