{{ $align := .Get "align" | default "center" }} {{ $caption := .Get "caption" }} {{ $height := .Get "height" }} {{ $image := .Get "image" }} {{ $images := .Get 0 | default (.Get "images") }} {{ $justify := .Get "justify" | default "center" }} {{ $maxheight := .Get "maxheight" }} {{ $maxwidth := .Get "maxwidth" }} {{ $method := .Get "method" | default "resize" }} {{ $number := .Get "number" }} {{ $numbered := .Get "numbered" }} {{ $options := .Get "options" | default "550x webp picture Lanczos" }} {{ $raw := .Get "raw" }} {{ $type := .Get "type" | default "rows" }} {{ $width := .Get "width" }} {{ if $image }} {{ $link := $image }} {{ $resource := "" }} {{ if not $raw }} {{ $resource = partial "paige/func-resource.html" (dict "page" .Page "url" $image ) }} {{ $link = $resource.RelPermalink }} {{ end }} {{ if $caption }} {{ partial "paige/image-figure.html" (dict "caption" $caption "compact" true "gap" 2 "height" $height "link" $link "maxheight" $maxheight "maxwidth" $maxwidth "method" $method "options" $options "page" .Page "raw" $raw "resource" $resource "src" $image "table" true "width" $width ) }} {{ else }} {{ partial "paige/a.html" (dict "content" (partial "paige/img.html" (dict "class" "img-fluid" "height" $height "maxheight" $maxheight "maxwidth" $maxwidth "method" $method "options" $options "resource" $resource "src" $image "width" $width )) "href" $link ) }} {{ end }} {{ else }} {{ $inner := chomp .Inner }} {{ $resources := slice }} {{ $showcaption := $caption }} {{ with $images }} {{ with $.Page.Resources.Match . }} {{ $resources = . }} {{ else }} {{ $resources = resources.Match . }} {{ end }} {{ else }} {{ with .Page.Resources.ByType "image" }} {{ $resources = . }} {{ else }} {{ $resources = resources.ByType "image" }} {{ end }} {{ end }} {{ if $caption }} {{ if $number }} {{ $caption = printf "%v %v: %v" (i18n "paige_figure") $number $caption }} {{ end }} {{ else }} {{ if $number }} {{ $caption = printf "%v %v" (i18n "paige_figure") $number }} {{ $showcaption = true }} {{ else if $numbered }} {{ $showcaption = true }} {{ end }} {{ end }}
{{ if eq $type "grid" }}
{{ with $inner }} {{ . }} {{ else }} {{ range $resources }}
{{ partial "paige/a.html" (dict "content" (partial "paige/img.html" (dict "class" "img-fluid" "height" $height "maxheight" $maxheight "maxwidth" $maxwidth "method" $method "options" $options "resource" . "width" $width )) "href" .RelPermalink ) }}
{{ end }} {{ end }}
{{ else if eq $type "rows" }}
{{ with $inner }} {{ . }} {{ else }} {{ range $resources }} {{ partial "paige/a.html" (dict "content" (partial "paige/img.html" (dict "class" "img-fluid" "height" $height "maxheight" $maxheight "maxwidth" $maxwidth "method" $method "options" $options "resource" . "width" $width )) "href" .RelPermalink ) }} {{ end }} {{ end }}
{{ else }} {{ errorf "invalid type: %q" $type }} {{ end }} {{ if $showcaption }}
{{ $caption }}
{{ end }}
{{ end }}