From 3564d9ebfa9a3a1c84ef2e1bb64a80763e30d494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 20 Sep 2020 14:36:54 +0200 Subject: [PATCH] expose mermaid options in config.toml #4 --- exampleSite/config.toml | 1 + layouts/partials/footer.html | 8 ++++++++ 2 files changed, 9 insertions(+) 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 }}