hi im trying to inline a svg file i have in /static into a style tag like this:
{{ $svg := partial "svg.html" "sun" }}
<label for="theme-switch" style="{{ $svg | safeCSS}}" class="switch-label">
<img id="switcher-image" width="22px" height="22px">
</label>
svg.html
{{ $svg := . }}
{{ $path := printf "/static/images/svg/%s.svg" $svg }}
{{ $file := $path | readFile | safeHTML | printf "mask-image: url(\"data:image/svg+xml;utf8,%s\");" | safeCSS }}
{{ $file }}
output:
<label for="theme-switch" style="
mask-image: url(&#34;data:image/svg&#43;xml;utf8,&lt;svg class=&#34;light-icon&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M12 3V4M12 20V21M4 12H3M6.31412 6.31412L5.5 5.5M17.6859 6.31412L18.5 5.5M6.31412 17.69L5.5 18.5001M17.6859 17.69L18.5 18.5001M21 12H20M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;/svg&gt;
&#34;);" class="switch-label">
but the output contains formatted " etc.., how can i make this partial do what i want >_< ty!