{{- $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 := .content }} {{- $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 "make-random-md5.hugo" $page) .id }} {{- with $page }}
{{ if ne "<" (substr (strings.TrimLeft "\n\r\t " $content) 0 1) }}

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

{{- end }}