{{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'expand' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }} {{- end }} {{- $content := trim .content "\n\r\t " }} {{- $hasContent := ne (strings.TrimLeft "

" $content) "" }} {{- if not (hasPrefix $content "<") }} {{- $content = printf "

\n%s" $content }} {{- end }} {{- $title := .title | default (T "Expand-title") }} {{- $title = trim $title " " }} {{- $expanded := .expanded | default false }} {{- if and (isset . "open") (or (ne (printf "%T" .open) "string") (ne (trim .open " " ) "")) }} {{- warnf "%q: DEPRECATED parameter 'open' for shortcode 'expand' found, use 'expanded' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#630" $page.File.Filename }} {{- $expanded = .open }} {{- end }} {{- if eq (printf "%T" $expanded) "string" }} {{- $expanded = (eq $expanded "true") }} {{- end }} {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "_relearn/makeRandomMd5.gotmpl" $page) .id }} {{- with $page }} {{- if $hasContent -}}

{{ $content | safeHTML }}
{{- end }} {{- end }}