#204, Add mermaid config customization, upgrade mermaidjs

This commit is contained in:
Alex Shpak 2020-08-16 18:57:38 +02:00
parent 796468766f
commit 8f64ee74aa
3 changed files with 16 additions and 12 deletions

6
assets/mermaid.json Normal file
View File

@ -0,0 +1,6 @@
{
"flowchart": {
"useMaxWidth":true
},
"theme": "default"
}

View File

@ -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

File diff suppressed because one or more lines are too long