20 lines
911 B
HTML
20 lines
911 B
HTML
{{- $page := .page }}
|
|
{{- if and (not $page) .context }}
|
|
{{- $page = .context }}
|
|
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
|
|
{{- 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" $filepath }}
|
|
{{- end }}
|
|
|
|
{{- $style := .style | default "" }}
|
|
{{- $color := .color | default "" }}
|
|
{{- $icon := .icon | default "" }}
|
|
{{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "mode" "icon" "style" $style "color" $color "icon" $icon) }}
|
|
{{- $style = $boxStyle.style }}
|
|
{{- $color = $boxStyle.color }}
|
|
{{- $icon = $boxStyle.icon }}
|
|
|
|
{{- with $page }}
|
|
{{- if $icon -}}
|
|
<i class="{{ $icon }}{{ with $style }} cstyle {{ . }}{{ end }}"{{ with $color }} style="color: {{ . }};"{{ end }}></i>
|
|
{{- end }}
|
|
{{- end }} |