Files
docker-docs/layouts/partials/icon.html
David Karlsson 1f42d72ed3 hugo: support for inline svg icons
This commit adds support for icon optimization using inline svgs,
improving site performance.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-25 12:28:38 +01:00

9 lines
248 B
HTML

{{- $svg := resources.Get (fmt.Printf "icons/%s-fill.svg" .) }}
{{- if not $svg }}
{{- errorf "Failed to get icon: %s" . }}
{{ end }}
{{- if not $svg.Content }}
{{- errorf "Failed to get icon: %s" . }}
{{- end }}
{{- safe.HTML $svg.Content -}}