2023-07-27 16:14:55 +02:00
|
|
|
{{- $page := .page }}
|
|
|
|
{{- if and (not $page) .context }}
|
|
|
|
{{- $page = .context }}
|
2023-11-21 00:53:33 +01:00
|
|
|
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
|
2023-07-27 16:14:55 +02:00
|
|
|
{{- end }}
|
2022-12-02 18:31:54 +01:00
|
|
|
{{- $icon := .icon | default "" }}
|
|
|
|
{{- $icon = trim $icon " " }}
|
|
|
|
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
|
|
|
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
|
|
|
{{- end }}
|
2023-07-27 16:14:55 +02:00
|
|
|
{{- with $page }}
|
2023-06-08 13:36:12 +02:00
|
|
|
{{- if $icon -}}
|
2022-12-02 18:31:54 +01:00
|
|
|
<i class="{{ $icon }}"></i>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|