{{- if not ($.Page.Scratch.Get "thumbcount") }}{{ end }} {{- $.Page.Scratch.Add "thumbcount" 1 -}} {{- $gallery := $.Page.Params.gallery | default "" -}} {{- $thumb := .Get "src" | default (printf "%s." (.Get "thumb") | replace (.Get "link") ".") | printf "%s%s" $gallery}} {{- $link := .Get "src" | default (.Get "link") | printf "%s%s" $gallery}} {{- $width := "200px" -}}{{ if .Get "width" }}{{ $width := (.Get "width") }}{{ end }}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
{{- with .Get "title" }}{{.}}{{ end }} {{- if or (.Get "caption") (.Get "attr")}}

{{- .Get "caption" -}} {{- with .Get "attrlink"}}{{ .Get "attr" }}{{ else }}{{ .Get "attr"}}{{ end -}}

{{- end }}
{{- end }}