{{- 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*" }} {{ $nr := .Destination }} {{- $pic := index $images (sub (int $nr) 1) -}} {{- $image := .Page.Resources.GetMatch (printf "%s" ($pic | safeURL)) -}} {{ if ne $image nil }}
{{- $permalink := "" -}} {{- if ne $image nil -}} {{- $permalink = $image.RelPermalink -}} {{- else -}} {{- $image = imageConfig (printf "static/%s" (.Destination | safeURL)) -}} {{- $permalink = (printf "/%s" (.Destination | safeURL)) -}} {{- end -}}
{{ .Text }}
{{ .Text }}
{{ end }} {{ end }} {{- end -}}