{{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/5/#5-18-0" $page.File.Filename }} {{- end }} {{- $color := .color | default "" }} {{- $content := .content }} {{- $style := .style | default "default" }} {{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "style" $style "title" .title "icon" .icon) }} {{- $title := trim ($boxStyle.title) " " }} {{- $icon := trim ($boxStyle.icon) " " }} {{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }} {{- $icon = printf "fa-fw fas fa-%s" $icon }} {{- end }} {{- with $page -}} {{ if or $icon $title }}{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | .RenderString }}{{ end }}{{ end }}{{ $content | safeHTML }} {{- end }}