{{ if .Get "default" }} DEFAULT {{- if .Get "link" -}} {{- end -}} TEST1 {{- $u := urls.Parse (.Get "src") -}} {{- $src := $u.String -}} {{- if not $u.IsAbs -}} {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} {{- $src = .RelPermalink -}} {{- end -}} {{- end -}} TEST2 {{ with .Get TEST3 {{- if .Get "link" }}{{ end -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
TEST4 {{ with (.Get "title") -}} TEST5

{{ . }}

{{- end -}} {{- if or (.Get "caption") (.Get "attr") -}}

TEST6 {{- .Get "caption" | markdownify -}} TEST6.5 {{- with .Get "attrlink" }} {{- end -}} TEST7 {{- .Get "attr" | markdownify -}} {{- if .Get "attrlink" }}{{ end }}

{{- end }} TEST8
{{- end }} {{ else }} NON-DEFAULT {{ $url := urls.Parse (.Get "src") }} {{ $altText := .Get "alt" }} {{ $caption := .Get "caption" }} {{ $href := .Get "href" }} {{ $class := default "mx-auto my-0 rounded-md" (.Get "class") }} {{$class}} {{ $file := $url.Path }} {{ $img := .Page.Resources.GetMatch $file }} {{- if and (not $img) .Page.File }} {{ $path := path.Join .Page.File.Dir $file }} {{ $img = resources.Get $path }} {{ end -}} {{ with $href }}{{ end }} {{- with $img -}} TEST1 {{ $lazy := $.Page.Site.Params.enableImageLazyLoading | default true }} {{ $webp := $.Page.Site.Params.enableImageWebp | default true }} {{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "lazy" $lazy "webp" $webp) }} {{$class}} TEST2 {{- else -}} TEST3 {{ $altText }} {{- end -}} {{ with $href }}{{ end }} {{ with $caption }}
{{ . | markdownify }}
{{ end }} {{ end }}