{{ $title := .Get 0 }} {{ $originals := (.Page.Resources.ByType "image") }}
{{ range $param := last (sub (len .Params) 1) .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 "mp4" }} {{ else }} {{- if eq $extension "png" -}} {{ $original := $originals.GetMatch (printf "*%s" (path.Base $src)) }} {{ $resized := $original.Resize "800x q90 jpg" }} {{ $title }} {{- else -}} {{ $title }} {{- end -}} {{ end }}
{{ end }}
{{ if $title }}

{{ $title }}

{{ end }}