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