diff --git a/assets/js/theme.js b/assets/js/theme.js index 71aaa49a..6b0c6249 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -601,11 +601,11 @@ class FixIt { } initMermaid() { - if (!window.mermaid?.initialize) { + if (!this.config.mermaid) { return; } const _initializeAndRun = () => { - const themes = window.mermaid.themes ?? ['default', 'dark']; + const themes = this.config.mermaid.themes ?? ['default', 'dark']; window.mermaid.initialize({ securityLevel: 'loose', startOnLoad: false, diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 3d010853..cfebaffb 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -115,10 +115,13 @@ {{- /* mermaid */ -}} {{- if .Store.Get "hasMermaid" -}} + {{- $config = dict "themes" .Site.Params.mermaid.themes | dict "mermaid" | merge $config -}} {{- end -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index eb2646fe..349ea2af 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.14-28759d50" -}} +{{- .Scratch.Set "version" "v0.3.14-c08671de" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}