add optional mermaid shotcode

This commit is contained in:
James Ray 2022-03-06 13:24:20 -05:00
parent e151dad461
commit 98ee41b0fb
No known key found for this signature in database
GPG key ID: E8AD82EF4759BD72
3 changed files with 7 additions and 0 deletions

View file

@ -5,6 +5,9 @@
<!------ ADD COMMON HEADERS -------->
{{- partial "header.html" . -}}
{{ template "_internal/opengraph.html" . }}
{{ if site.Params.features.mermaid.enabled}}
{{ partial "mermaid.html" . }}
{{ end }}
<!------ ADD PAGE SPECIFIC HEADERS ------->
{{ block "header" . }} {{ end }}

View file

@ -0,0 +1,2 @@
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>

View file

@ -0,0 +1,2 @@
{{ $_hugo_config := `{ "version": 1 }` }}
<div class="mermaid" align="{{ if .Get "align" }}{{ .Get "align" }}{{ else }}center{{ end }}">{{ safeHTML .Inner }}</div>