hugo-theme-relearn/layouts/partials/shortcodes/icon.html

15 lines
571 B
HTML
Raw Normal View History

{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
2024-09-29 21:54:17 +00:00
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- end }}
2022-12-02 17:31:54 +00:00
{{- $icon := .icon | default "" }}
{{- $icon = trim $icon " " }}
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
{{- end }}
{{- with $page }}
2023-06-08 11:36:12 +00:00
{{- if $icon -}}
2022-12-02 17:31:54 +00:00
<i class="{{ $icon }}"></i>
{{- end }}
{{- end }}