hugo-theme-relearn/layouts/partials/shortcodes/icon.html
2022-12-02 18:31:54 +01:00

11 lines
No EOL
301 B
HTML

{{- $context := .context }}
{{- $icon := .icon | default "" }}
{{- $icon = trim $icon " " }}
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
{{- end }}
{{- with $context }}
{{- if $icon }}
<i class="{{ $icon }}"></i>
{{- end }}
{{- end }}