{{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }} {{- end }} {{- $class := .class | default "notices" }} {{- $containerstyle := .containerstyle | default "div" }} {{- $containerclass := .containerclass | default slice | append "box-content" }} {{- $color := .color | default "" }} {{- $content := trim .content "\n\r\t " }} {{- $hasContent := ne (strings.TrimPrefix "
" $content) "" }} {{- if not (hasPrefix $content "<") }} {{- $content = printf "
\n%s" $content }}
{{- end }}
{{- $groupid := .groupid }}
{{- $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 }}
{{- $expander := false }}
{{- $expanded := .expanded | default "" }}
{{- if $hasContent }}
{{- if eq (printf "%T" $expanded) "string" }}
{{- if ne (trim $expanded " ") "" }}
{{- $expander = true }}
{{- $expanded = (eq $expanded "true") }}
{{- end }}
{{- else }}
{{- $expander = true }}
{{- end }}
{{- end }}
{{- $params := .params | default dict }}
{{- $classes := split (index $params "class" | default "") " " }}
{{- $classes = $classes | append "box" }}
{{- $classes = $classes | append "cstyle" }}
{{- $classes = $classes | append $class }}
{{- $classes = $classes | append $style }}
{{- if $expander }}
{{- $classes = $classes | append "expand" }}
{{- else }}
{{- $expanded = true }}
{{- end }}
{{- $params = dict "class" (delimit $classes " ") | merge $params }}
{{- if $color }}
{{- $styles := split (index $params "style" | default "") ";" }}
{{- $styles = $styles | append (printf "--VARIABLE-BOX-color: %s" $color) }}
{{- $params = dict "style" (delimit $styles ";") | merge $params }}
{{- end }}
{{ if $groupid }}
{{- $params = dict "name" $groupid | merge $params }}
{{- end }}
{{- with $page }}
{{- if or $icon $title $hasContent -}}
{{ if $expander }}
{{ end }}{{ if $icon }}
{{ end }}{{ if $title }}
{{ $title | .RenderString }}{{ else }}
{{ T "Details" }}{{ end }}
{{- if $hasContent }}
{{ printf " <%s class=\"%s\">" $containerstyle (delimit $containerclass " ") | safeHTML }}
{{ $content | safeHTML }}
{{ printf " %s>" $containerstyle | safeHTML }}
{{- end }}