summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/mermaid.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/mermaid.html')
-rw-r--r--layouts/shortcodes/mermaid.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html
new file mode 100644
index 0000000..d156f07
--- /dev/null
+++ b/layouts/shortcodes/mermaid.html
@@ -0,0 +1,9 @@
+{{ if not (.Page.Scratch.Get "mermaid") }}
+<!-- Include mermaid only first time -->
+<script src="{{ "mermaid.min.js" | absURL }}"></script>
+{{ .Page.Scratch.Set "mermaid" true }}
+{{ end }}
+
+<p class="mermaid flex align-center">
+ {{ .Inner }}
+</p>