{{- if strings.HasPrefix .Destination "http" -}} {{ .Text }}
{{ .Text }}
{{- else -}} {{ if .Page.Resources.ByType "image" }} {{ $nr := .Destination }} {{- $pic := index (.Page.Resources.ByType "image") (int $nr) -}} {{- $image := .Page.Resources.GetMatch (printf "%s" ($pic | safeURL)) -}}
{{- $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 -}}