{{- /* {{< figure "bild.jpg" "Bildunterschrift" >}} */ -}}
{{- $src := or (.Get "src") (.Get 0) -}}
{{- $caption := or (.Get "caption") (.Get 1) -}}
{{- with .Page.Resources.GetMatch $src -}}
  {{- $img := .Resize "1200x webp q82" }}
  <figure class="content-figure">
    <a href="{{ .RelPermalink }}">
      <img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}"
           alt="{{ $caption | plainify }}" loading="lazy" decoding="async">
    </a>
    {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
  </figure>
{{- else -}}
  {{- warnf "figure: %q not found in %s" $src .Page.Path -}}
{{- end -}}
