{{- $img := (.page.Resources.ByType "image").GetMatch "thumbnail.*" }} {{- $link := .link }} {{- with $img }}
{{- with $link }} {{ $img.Title }} {{- else }} {{ $img.Title }} {{- end }}
{{- end }}