{{- if strings.HasPrefix .Destination "http" -}} {{ .Text }}
{{ .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)) -}} {{- $permalink := "" -}} {{- if ne $image nil -}} {{- $permalink = $image.Permalink -}} {{- else -}} {{- $image = imageConfig (printf "static/%s" (.Destination | safeURL)) -}} {{- $permalink = (printf "/%s" (.Destination | safeURL)) -}} {{- end -}} {{ .Text }}
{{ .Text }}
{{ end }} {{ end }} {{- end -}}