This code passes class and alt variables, but no image. How to fix it?
{{- with resources.Get "img/imagemain.webp" -}}
{{ $ctx := dict
"src" .
"class" "parallax-img"
"alt" "Main title"
}}
{{- partial "imgoptim_static" $ctx -}}
{{ end -}}
and partial has this:
{{ $src := . }}
{{ $class := .class }}
{{ $alt := .alt }}
{{- with $src }}
<img srcset='
{{- if ge .Width "480" -}}
{{ (.Resize "480x").RelPermalink }} 480w,
{{- end }}
{{- if ge .Width "800" -}}
{{ (.Resize "800x").RelPermalink }} 800w,
{{- end }}
{{- if ge .Width "1200" -}}
{{ (.Resize "1200x").RelPermalink }} 1200w{{- end }}' sizes="(max-width:600px) 480px, (max-width:1024px) 800px, 1200px" src="{{ .RelPermalink }}" class="{{ .class }}" alt="{{ .alt }}">
{{- end }}