mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 08:41:07 +00:00
5f67151550
This relates to #9577 – there's no concept a body element in SVG, so we might as well use an exsisting "Hugo term".
18 lines
565 B
HTML
18 lines
565 B
HTML
{{ $width := .Attributes.width }}
|
|
{{ $height := .Attributes.height }}
|
|
{{ $class := .Attributes.class | default "" }}
|
|
<div class="goat svg-container {{ $class }}">
|
|
{{ with diagrams.Goat .Inner }}
|
|
<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 }}>
|
|
{{ .Inner }}
|
|
</svg>
|
|
{{ end }}
|
|
</div>
|