{{- if not ($.Page.Scratch.Get "figurecount") }}{{ end }} {{- $.Page.Scratch.Add "figurecount" 1 -}} {{- $filetype := index (findRE "[^.]+$" (.Get "link") ) 0 }} {{- $thumb := .Get "src" | default (printf "%s.%s" (replaceRE "\\.[^.]+$" (.Get "thumb") (.Get "link") ) $filetype ) | relURL }}
{{ with .Get "link" | default (.Get "src") }}{{ end }} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") (.Get "attrlink") }}
{{- with .Get "title" }}

{{.}}

{{ end }} {{- with .Get "caption" }}

{{.}}

{{ end }} {{- if or (.Get "attr") (.Get "attrlink") }} {{- end }}
{{- end }}