{{ $alt := .alt }}
{{ $caption := .caption }}
{{ $height := .height }}
{{ $link := .link }}
{{ $method := .method }}
{{ $options := .options }}
{{ $page := .page }}
{{ $resource := .resource }}
{{ $src := .src }}
{{ $table := .table }}
{{ $title := .title }}
{{ $width := .width }}

{{ $class := "img-fluid" }}
{{ if $caption }}
    {{ $class = "figure-img img-fluid" }}
{{ end }}

{{ $content := partial "paige/img.html" (dict
    "alt" $alt
    "class" $class
    "height" $height
    "method" $method
    "options" $options
    "page" $page
    "resource" $resource
    "src" $src
    "title" $title
    "width" $width
) }}

{{ if $link }}
    {{ $content = partial "paige/a.html" (dict
        "content" $content
        "href" $link
    ) }}
{{ end }}

<figure class="{{ if $table }} d-table mb-0 {{ end }} paige-figure text-center">
    {{ $content }}
    {{ with $caption }}
        <figcaption class="figure-caption" {{ if $table }} style="caption-side: bottom; display: table-caption" {{ end }}>{{ . }}</figcaption>
    {{ end }}
</figure>
