backy/docs/themes/hugo-theme-relearn/layouts/partials/shortcodes/icon.html

11 lines
302 B
HTML
Raw Permalink Normal View History

{{- $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 }}