2023-08-03 06:14:55 +08:00
|
|
|
{{- $icon := index site.Data.icons .name -}}
|
2023-07-20 05:11:34 +08:00
|
|
|
|
|
|
|
{{- if not $icon -}}
|
|
|
|
{{ errorf "icon %q not found" .name }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $icon = $icon | safeHTML -}}
|
|
|
|
|
|
|
|
{{- if .attributes -}}
|
|
|
|
{{- $icon = replaceRE "<svg" (printf "<svg %s" .attributes) $icon -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- return ($icon | safeHTML) -}}
|