{{ $url := urls.Parse .src }} {{ $altText := .alt }} {{ $class := .class | default "mx-auto my-0 rounded-md" }} {{ $lazyLoad := .context.Page.Site.Params.enableImageLazyLoading | default true }} {{ $webp := .context.Page.Site.Params.enableWebp | default true }} {{ $lqip := .context.Page.Site.Params.enableLqip | default true }} {{ if findRE "^https?" $url.Scheme }} {{ $altText }} {{ else }} {{ $resource := "" }} {{ if .context.Page.Resources.GetMatch ($url.String) }} {{ $resource = .context.Page.Resources.GetMatch ($url.String) }} {{ else if resources.GetMatch ($url.String) }} {{ $resource = resources.Get ($url.String) }} {{ end }} {{ with $resource }} {{ if (and (ne .MediaType.SubType "svg") $lqip) }} {{ $lqip := (.Resize "20x webp").Content | base64Encode }} {{ else }} {{ end }} {{ if (and (ne .MediaType.SubType "svg") $webp) }} {{ end }} {{ $altText }} {{ else }} {{ $altText }} {{ end }} {{ end }}