{{- $orignal := resources.Get .path }} {{- $png := $orignal.Resize (printf "%dx%d png q75" $orignal.Width $orignal.Height) }} {{- $webp := $orignal.Resize (printf "%dx%d webp q75" $orignal.Width $orignal.Height) }} <picture> <source type="image/webp" srcset="{{ $webp.Permalink }}"> <img src="{{ $png.Permalink }}" alt="{{ .alt | default "" }}" title="{{ .alt }}" width="{{ .width | default $png.Width }}" height="{{ .height | default $png.Height }}" {{- if .class}}class="{{ .class }}" {{end}} {{- if .style}}style="{{ .style | safeCSS }}" {{end}} /> </picture>