portails/layouts/shortcodes/mermaid.html

9 lines
333 B
HTML
Raw Normal View History

2021-07-02 11:08:31 +02:00
{{ if .Page.Params.mermaid -}}
2021-06-30 20:32:28 +02:00
<div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
{{ $data := replaceRE "(^\\s+```)" "" .Inner -}}
{{ replaceRE "(```\\s+$)" "" $data -}}
</div>
2021-07-01 16:21:03 +02:00
{{ else -}}
2021-07-02 11:08:31 +02:00
{{ errorf "Failed to process mermaid shortcode: %s. Set mermaid to true in page front matter." .Position }}
2021-07-01 16:21:03 +02:00
{{ end -}}