summaryrefslogtreecommitdiff
path: root/layouts/_markup/render-image.html
blob: e2fbfd7ff13b8d9164c9eaf72dcb9c3e02f5478e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{{- $src := .Destination -}}
{{- $alt := .Text | default "" -}}
{{- $caption := .Title | default "" -}}
{{- $class := .Attributes.class | default "" -}}

<figure>
    <a href="{{ $src }}" data-fancybox data-caption="{{ $caption }}" class="fancybox-link">
        <img
            class="lazy {{ $class }}" loading="lazy"
            src="{{ $src }}" alt="{{ $alt }}"
        />
    </a>
    {{- if $caption }}
    <figcaption>
        <h4>{{ $caption | markdownify }}</h4>
    </figcaption>
    {{- end }}
</figure>