add optional mermaid shotcode
This commit is contained in:
parent
e151dad461
commit
98ee41b0fb
3 changed files with 7 additions and 0 deletions
|
@ -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 }}
|
||||
|
|
2
layouts/partials/mermaid.html
Normal file
2
layouts/partials/mermaid.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script>mermaid.initialize({startOnLoad:true});</script>
|
2
layouts/shortcodes/mermaid.html
Normal file
2
layouts/shortcodes/mermaid.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
<div class="mermaid" align="{{ if .Get "align" }}{{ .Get "align" }}{{ else }}center{{ end }}">{{ safeHTML .Inner }}</div>
|
Loading…
Add table
Add a link
Reference in a new issue