mirror of https://github.com/istio/istio.io.git
Add support for mermaid.js (#13115)
Fixes https://github.com/istio/istio.io/issues/13093
This commit is contained in:
parent
f8c8b54ff5
commit
53ff275bb4
|
@ -145,6 +145,19 @@
|
||||||
|
|
||||||
<!-- our own stuff -->
|
<!-- our own stuff -->
|
||||||
<script src="/js/all.min.js" data-manual defer></script>
|
<script src="/js/all.min.js" data-manual defer></script>
|
||||||
|
{{ if .Page.Store.Get "needMermaid" -}}
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
|
||||||
|
mermaid.initialize({
|
||||||
|
startOnLoad: true,
|
||||||
|
'theme': 'base',
|
||||||
|
'themeVariables': {
|
||||||
|
'primaryColor': '#B7D4FF',
|
||||||
|
'primaryBorderColor': '#9BB9FF',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
{{ partial "events.html" (dict "page" . "kind" "sticker") }}
|
{{ partial "events.html" (dict "page" . "kind" "sticker") }}
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
{{ .Page.Store.Set "needMermaid" true }}
|
||||||
|
<div class="mermaid" align="center">{{ safeHTML .Inner }}</div>
|
Loading…
Reference in New Issue