summaryrefslogtreecommitdiffstats
path: root/docs/layouts/_default
diff options
context:
space:
mode:
Diffstat (limited to 'docs/layouts/_default')
-rw-r--r--docs/layouts/_default/_markup/render-codeblock-goat.html18
-rw-r--r--docs/layouts/_default/_markup/render-codeblock-mermaid.html4
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/layouts/_default/_markup/render-codeblock-goat.html b/docs/layouts/_default/_markup/render-codeblock-goat.html
new file mode 100644
index 000000000..b1e57e94a
--- /dev/null
+++ b/docs/layouts/_default/_markup/render-codeblock-goat.html
@@ -0,0 +1,18 @@
+{{ $width := .Attributes.width }}
+{{ $height := .Attributes.height }}
+{{ $class := .Attributes.class | default "" }}
+<div class="goat svg-container {{ $class }}">
+ {{ with diagrams.Goat .Code }}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ font-family="Menlo,Lucida Console,monospace"
+ {{ if or $width $height }}
+ {{ with $width }}width="{{ . }}"{{ end }}
+ {{ with $height }}height="{{ . }}"{{ end }}
+ {{ else }}
+ viewBox="0 0 {{ .Width }} {{ .Height }}"
+ {{ end }}>
+ {{ .Body }}
+ </svg>
+ {{ end }}
+</div>
diff --git a/docs/layouts/_default/_markup/render-codeblock-mermaid.html b/docs/layouts/_default/_markup/render-codeblock-mermaid.html
new file mode 100644
index 000000000..15e4fdfbb
--- /dev/null
+++ b/docs/layouts/_default/_markup/render-codeblock-mermaid.html
@@ -0,0 +1,4 @@
+<div class="mermaid">
+ {{- .Code | safeHTML }}
+</div>
+{{ .Page.Store.Set "hasMermaid" true }}