mirror of https://github.com/crossplane/docs.git
Add support for Mermaid diagrams
Per instructions from Hugo: https://gohugo.io/content-management/diagrams/#mermaid-diagrams The styling could probably be updated to be more in line with the rest of the docs, but this already looks better to me than the goat ASCII diagrams Hugo supports out of the box. Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
parent
2e993500cb
commit
cb1f9d2f9c
|
@ -0,0 +1,4 @@
|
|||
<pre class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</pre>
|
||||
{{ .Page.Store.Set "hasMermaid" true }}
|
|
@ -75,3 +75,10 @@
|
|||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
||||
{{ end }}
|
Loading…
Reference in New Issue