{{ $url := urls.Parse .Destination }} {{ $altText := .Text }} {{ $caption := .Title }} {{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }} {{ if findRE "^https?" $url.Scheme }}
{{ $altText }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ else }} {{ $resource := "" }} {{ if $.Page.Resources.GetMatch ($url.String) }} {{ $resource = $.Page.Resources.GetMatch ($url.String) }} {{ else if resources.GetMatch ($url.String) }} {{ $resource = resources.Get ($url.String) }} {{ end }} {{ with $resource }}
{{ if ne .MediaType.SubType "svg" }} {{ $lqip := .Resize "20x webp" }}
{{ end }} {{ $altText }} {{ if ne .MediaType.SubType "svg" }}
{{ end }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ else }}
{{ $altText }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ end }} {{ end }}