svg-include shortcode
·
1 min read
·
edit
result
usage
{{< svg/includev1 "images/inhouse/01-the-birth-of-me.svg" >}}
code
{{ $file := printf "static/%s" (.Get 0) }}
<div class="svg-container">
{{ with readFile $file }}
{{ . | safeHTML }}
{{ else }}
<!-- SVG file not found: {{ .Get 0 }} -->
{{ end }}
</div>
<style>
.svg-container {
width: 100%;
}
.svg-container svg {
display: block;
width: 100%;
height: auto;
}
</style>
refs
- GPT-5.3, “Hugo Include SVG Shortcode”, ChatGPT, 2 May 2026, url https://chatgpt.com/c/69f5cb39-1d04-8320-8f42-3e389d03a76b [20260502].
- GPT-5.3, “SVG Shortode Naming”, ChatGPT, 2 May 2026, url https://chatgpt.com/c/69f5c947-2468-839b-98e5-6b0b7423162e [20260502].