feat(helper): add helper/icon

This commit is contained in:
Jimmy Cai
2020-10-10 00:27:56 +02:00
parent 4e646fe15e
commit 871e8c0bd5
6 changed files with 12 additions and 6 deletions
+6
View File
@@ -0,0 +1,6 @@
{{- $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 -}}