{{ $originals := (.Page.Resources.ByType "image") }}
{{ range $param := .Params }} {{ $items := split $param "|" }} {{ $src := (index $items 0) }} {{ $title := (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_width := math.Min $original.Width 1024 }} {{ $resized := $original.Resize (print $resized_width "x q90 jpg" ) }} {{ $title }} {{- else -}} {{ $title }} {{- end -}} {{ end }} {{ if $title }}

{{ $title }}

{{ end }}
{{ end }}