2022-06-22 18:32:18 +00:00
|
|
|
{{- $context := .context }}
|
|
|
|
{{- $content := .content }}
|
|
|
|
{{- $align := .align | default "center" }}
|
2023-02-05 10:13:03 +00:00
|
|
|
{{- $zoom := $context.Site.Params.mermaidZoom | default false }}
|
|
|
|
{{- with $context.Page.Params.mermaidZoom }}
|
|
|
|
{{- $zoom = . }}
|
|
|
|
{{- if eq (printf "%T" .) "string" }}
|
|
|
|
{{- $zoom = (eq . "true") }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .zoom }}
|
|
|
|
{{- $zoom = . }}
|
|
|
|
{{- if eq (printf "%T" .) "string" }}
|
|
|
|
{{- $zoom = (eq . "true") }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- with $context }}
|
2023-02-05 10:13:03 +00:00
|
|
|
<div class="mermaid align-{{ $align }}{{ if $zoom }} zoom{{ end }}">
|
2022-10-07 18:08:12 +00:00
|
|
|
{{- replaceRE "'" "'" ( replaceRE """ "\"" ( $content | safeHTML ) ) -}}
|
2022-06-22 18:32:18 +00:00
|
|
|
</div>
|
2022-07-11 21:52:59 +00:00
|
|
|
{{- .Page.Store.Set "hasMermaid" true }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- end }}
|