blog/themes/hugo-theme-stack/layouts/partials/helper/icon.html

6 lines
237 B
HTML
Raw Normal View History

2024-11-03 20:08:36 +03:00
{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}}
{{- if $iconFile -}}
{{- $iconFile.Content | safeHTML -}}
{{- else -}}
{{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}}
{{- end -}}