{{- 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 }}
{{- .Get "caption" -}} {{- with .Get "attrlink"}}{{ .Get "attr" }}{{ else }}{{ .Get "attr"}}{{ end -}}
{{- end }}