mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-21 19:09:29 +00:00
#204, Add mermaid config customization, upgrade mermaidjs
This commit is contained in:
parent
796468766f
commit
8f64ee74aa
6
assets/mermaid.json
Normal file
6
assets/mermaid.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"flowchart": {
|
||||||
|
"useMaxWidth":true
|
||||||
|
},
|
||||||
|
"theme": "default"
|
||||||
|
}
|
@ -1,11 +1,9 @@
|
|||||||
{{ if not (.Page.Scratch.Get "mermaid") }}
|
{{ if not (.Page.Scratch.Get "mermaid") }}
|
||||||
<!-- Include mermaid only first time -->
|
<!-- Include mermaid only first time -->
|
||||||
<script src="{{ "mermaid.min.js" | relURL }}"></script>
|
<script src="{{ "mermaid.min.js" | relURL }}"></script>
|
||||||
<script>
|
{{ with resources.Get "mermaid.json" }}
|
||||||
mermaid.initialize({
|
<script>mermaid.initialize({{ .Content | safeJS }})</script>
|
||||||
flowchart: { useMaxWidth:true }
|
{{ end }}
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{{ .Page.Scratch.Set "mermaid" true }}
|
{{ .Page.Scratch.Set "mermaid" true }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
14
static/mermaid.min.js
vendored
14
static/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user