Automatically detect MermaidJS shortcode
Rather than requiring metadata set in a page's front matter, automatically detect when detect when a page relies on MermaidJS.
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
<script src="{{ "js/jquery-ui-1.12.1.min.js" | relURL }}"></script>
|
||||
<script src="{{ "js/sweetalert-2.1.2.min.js" | relURL }}"></script>
|
||||
|
||||
{{ if eq .Params.mermaid true }}
|
||||
{{ if .HasShortcode "mermaid" }}
|
||||
<!-- Copied from https://unpkg.com/mermaid@8.5.0/dist/mermaid.min.js -->
|
||||
<script async src="{{ "js/mermaid.min.js" | relURL }}"></script>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user