2023-08-18 23:18:50 +01:00
|
|
|
{{/* Render raw svg icon from .Site.Data */}}
|
2023-08-02 23:14:55 +01:00
|
|
|
{{- $icon := index site.Data.icons .name -}}
|
2023-07-19 22:11:34 +01: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) -}}
|