{{- $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 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }} {{- end }} {{- $content := .content }} {{- $style := .style | default "" }} {{- $color := .color | default "" }} {{- $icon := .icon | default "" }} {{- $title := .title | default "" }} {{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "mode" "badge" "style" $style "color" $color "icon" $icon "title" $title) }} {{- $style = $boxStyle.style }} {{- $color = $boxStyle.color }} {{- $icon = $boxStyle.icon }} {{- $title = $boxStyle.title }} {{- with $page -}} {{ if or $icon $title }}{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | .RenderString }}{{ end }}{{ end }}{{ $content | safeHTML }} {{- end }}