{{ $title := .Get 0 }} {{ $originals := (.Page.Resources.ByType "image") }}
{{ range $param := last 2 .Params }} {{ $items := split $param "|" }} {{ $src := (index $items 0) }} {{ $subtitle := (index $items 1) }} {{ $split_src := split $src "." }} {{ $extension := index $split_src (sub (len $split_src) 1) }} {{- if eq $extension "png" -}} {{ $original := $originals.GetMatch (printf "*%s" (path.Base $src)) }} {{ $resized_width := math.Min $original.Width 1024 }} {{ $resized := $original.Resize (print $resized_width "x q90 jpg" ) }} {{ $title }} {{- else -}} {{ $title }} {{- end -}} {{ end }}
{{ with "title" }}

{{ $title }}

{{ end }}