2023-08-18 23:18:50 +01:00
|
|
|
{{- $name := .Get "name" | default (.Get 0) -}}
|
2023-09-26 08:15:31 +01:00
|
|
|
{{- $icon := index site.Data.icons $name -}}
|
|
|
|
{{- $attributes := .Get "attributes" | default "height=1em"}}
|
2023-08-18 00:16:49 +01:00
|
|
|
|
|
|
|
{{- if not $icon -}}
|
2023-09-26 08:15:31 +01:00
|
|
|
{{ errorf "icon %q not found" $name }}
|
2023-08-18 00:16:49 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $icon = replaceRE "<svg" (printf "<svg %s" $attributes) $icon -}}
|
|
|
|
|
2024-02-20 17:59:31 -05:00
|
|
|
<span class="hx-inline-block hx-align-text-bottom icon">
|
2023-08-18 00:16:49 +01:00
|
|
|
{{- $icon | safeHTML -}}
|
|
|
|
</span>
|