{{- if strings.HasPrefix .Destination "http" -}} {{ .Text }} {{- else -}} {{ $ignore := slice (.Page.Resources.GetMatch "banner*") }} {{ $images := .Page.Resources.ByType "image" }} {{ $images = complement $ignore $images }} {{ if where (.Page.Resources.ByType "image") ".File.TranslationBaseName" "!=" "banner*" }} {{ $img_tmp := "" }} {{ $dest := string (printf "%s.*" .Destination) }} {{ if .Page.Resources.GetMatch $dest }} {{- $img_tmp = .Page.Resources.GetMatch $dest -}} {{ else }} {{ $nr := .Destination }} {{- $img_tmp = index $images (sub (int $nr) 1) -}} {{ end }} {{ if $img_tmp }} {{- $image := .Page.Resources.GetMatch (printf "%s" ($img_tmp | safeURL)) -}}