-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: mermaid diagrams with parameters in site config
- Loading branch information
Showing
3 changed files
with
17 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,12 +1,11 @@ | ||||||||||
{{ $needmermaid := .Site.Params.mermaid.enable -}} | ||||||||||
{{ if ge hugo.Version "0.93.0" -}} | ||||||||||
{{ with .Site.Params.mermaid }} | ||||||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
deining
Author
Collaborator
|
if (!needMermaid) { | |
mermaid.initialize({startOnLoad: false}); | |
return; | |
} |
Not sure if this is very useful. I inherited this code and had to adapt it, so I provided the option to initialize mermaid with startOnLoad: false
.
With any code block given, mermaid is (now) initialized with startOnLoad: true
.
Hope that clarifies things. And yes, I was tempted to considerably shorten/cut down assets/js/mermiad.js
, but didn't dare to do so.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@deining - why these three added lines to trigger on
.Site.Params.mermaid
? What is the use case that wasn't covered before?