{{ $src := .Get "src" }} {{ $alt := .Get "alt" | default "" }} {{ $class := .Get
"class" | default "" }} {{ $size := .Get "size" | default "800x" }} {{ with
.Page.Resources.GetMatch $src }} {{ $resized := .Resize $size }} {{ $webp :=
$resized | images.Convert "webp" }}
<img
  src="{{ $webp.RelPermalink }}"
  alt="{{ $alt }}"
  class="{{ $class }}"
  width="{{ $webp.Width }}"
  height="{{ $webp.Height }}"
  loading="lazy"
/>
{{ else }}
<img src="{{ $src }}" alt="{{ $alt }}" class="{{ $class }}" loading="lazy" />
{{ end }}
