{{- $url := urls.Parse .Destination -}} {{- if $url.Scheme -}} {{/* third party image */}} {{ $.Text }} {{- else -}} {{/* internal image */}} {{- $img := .Page.Resources.GetMatch .Destination -}} {{- if not $img -}} {{- $img = resources.Get .Destination -}} {{- end -}} {{- if $img -}} {{- if eq $img.MediaType.MainType "video" -}}
{{- else -}} {{ $.Text }} {{- end -}} {{- else -}} {{- warnf "No image found for %s from %s" .Destination .Page.File }} {{- end -}} {{- end -}}