♻️ Use .HasShortcode for mermaid script

This commit is contained in:
James Panther
2021-08-21 08:54:42 +10:00
parent f0c6306e6c
commit 46a7031a3a
+1 -1
View File
@@ -35,7 +35,7 @@
</footer>
{{/* Include mermaid.js only on pages that use the shortcode */}}
{{- if (in (string .Content) "class=\"mermaid\"") -}}
{{- if .Page.HasShortcode "mermaid" -}}
<script src="https://unpkg.com/mermaid@8.11.4/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({ theme: "default" });