mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-12-04 21:23:07 +00:00
15 lines
No EOL
571 B
HTML
15 lines
No EOL
571 B
HTML
{{- $page := .page }}
|
|
{{- if and (not $page) .context }}
|
|
{{- $page = .context }}
|
|
{{- 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 }}
|
|
{{- $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 }}
|
|
{{- if $icon -}}
|
|
<i class="{{ $icon }}"></i>
|
|
{{- end }}
|
|
{{- end }} |