MitseaBlog/themes/hugo-theme-stack/layouts/partials/helper/icon.html
2022-10-11 17:34:41 +08:00

6 lines
237 B
HTML

{{- $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 -}}