diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 2c441940e9..895634c4e1 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -19,6 +19,7 @@ relativeURLs = true
disableLandingPageButton = true
disableMermaid = false
customMermaidURL = "https://unpkg.com/mermaid@8.8.0/dist/mermaid.min.js"
+ mermaidInitialize = "{ \"securityLevel\": \"loose\", \"startOnLoad\": true }"
titleSeparator = "::"
themeVariant = "relearn"
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 7d4c599fbc..65bdf01f46 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -74,9 +74,17 @@
{{ else }}
{{ end }}
+ {{ if isset .Params "mermaidinitialize" }}
+ {{ $.Scratch.Set "mermaidInitialize" .Params.mermaidInitialize }}
+ {{ else if isset .Site.Params "mermaidinitialize" }}
+ {{ $.Scratch.Set "mermaidInitialize" .Site.Params.mermaidInitialize }}
+ {{ else }}
+ {{ $.Scratch.Set "mermaidInitialize" "{ \"startOnLoad\": true }" }}
+ {{ end }}
{{ end }}