fix script loading
This commit is contained in:
parent
178b92b0a0
commit
048f98fd22
2 changed files with 8 additions and 6 deletions
|
@ -1,10 +1,12 @@
|
|||
{{ if not (.Page.Scratch.Get "mermaid") }}
|
||||
<!-- Include mermaid only first time -->
|
||||
<script defer src="{{ "js/mermaid.min.js" | relURL }}"></script>
|
||||
<script defer>
|
||||
mermaid.initialize({
|
||||
flowchart: { useMaxWidth: true }
|
||||
});
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
mermaid.initialize({
|
||||
flowchart: { useMaxWidth: true }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ .Page.Scratch.Set "mermaid" true }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue