{{ $baseURL := .Page.RelPermalink }} {{ $resources := .Page.Resources }} {{ $images := split (trim .Inner "\n") "!" }} {{ $patternTitle := "\\[([^]]*)\\]\\(.*\\)" }} {{ $patternPath := "\\[.*\\]\\(([^)]*)\\)" }}
{{ range $images }} {{ with . }} {{ $title := replaceRE $patternTitle "$1" . }} {{ $path := trim (replaceRE $patternPath "$1" .) " \n" }}
{{ $image := $resources.GetMatch (printf "*%s*" $path) }} {{ $orientation := 1 }} {{ with $image }}{{ with .Exif }}{{ $orientation = .Tags.Orientation }}{{ end }}{{ end }} {{ if eq $orientation 8 }} {{ $image = $image.Resize "300x r90" }} {{ else if eq $orientation 6 }} {{ $image = $image.Resize "300x r270" }} {{ end }} {{ $resized := $image.Resize "300x q100 webp" }} {{ $title }}
{{ end }} {{ end }}