aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-04-02 22:47:03 -0400
committerThedro Neely <thedroneely@gmail.com>2022-04-02 22:47:03 -0400
commitfb3f9b2d8146d3bcf6bac1fcc0113c242b2c42ed (patch)
treef6da2986a1140031ff5fc454e3c64cda7d3c987f
parent40e1ea11041031dd65be0a0541cad0b2dda71d3e (diff)
downloadthedroneely.com-fb3f9b2d8146d3bcf6bac1fcc0113c242b2c42ed.tar.gz
thedroneely.com-fb3f9b2d8146d3bcf6bac1fcc0113c242b2c42ed.tar.bz2
thedroneely.com-fb3f9b2d8146d3bcf6bac1fcc0113c242b2c42ed.zip
generators/hugo/layouts/_default/_markup: Add GoAT Diagrams
-rw-r--r--generators/hugo/themes/tdro/layouts/_default/_markup/render-codeblock-goat.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/generators/hugo/themes/tdro/layouts/_default/_markup/render-codeblock-goat.html b/generators/hugo/themes/tdro/layouts/_default/_markup/render-codeblock-goat.html
new file mode 100644
index 0000000..db8d8f2
--- /dev/null
+++ b/generators/hugo/themes/tdro/layouts/_default/_markup/render-codeblock-goat.html
@@ -0,0 +1,18 @@
+{{ $width := .Attributes.width }}
+{{ $height := .Attributes.height }}
+{{ $caption := .Attributes.caption }}
+<diagram-container>
+ {{ with diagrams.Goat .Inner }}
+ <svg font-family="'Fira Code', 'Lucida Console', 'Andale Mono', monospace"
+ xmlns="http://www.w3.org/2000/svg"
+ {{ if or $width $height }}
+ {{ with $width }}width="{{ . }}"{{ end }}
+ {{ with $height }}height="{{ . }}"{{ end }}
+ {{ else }}
+ viewBox="0 0 {{ .Width }} {{ .Height }}"
+ {{ end }}>
+ {{ .Inner }}
+ </svg>
+ {{ end }}
+ <figcaption class="has-text-grey-dark">{{ $caption }}</figcaption>
+</diagram-container>