16 lines
408 B
HTML
16 lines
408 B
HTML
{{/* Render raw svg icon from site data */}}
|
|
{{- $siteData := partial "utils/hugo-compat/site-data.html" . -}}
|
|
{{- $icon := index $siteData.icons .name -}}
|
|
|
|
{{- 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) -}}
|