2021-10-30 00:23:49 -05:00
|
|
|
{{ $hidecaption := index . "hidecaption" }}
|
|
|
|
{{ $type := index . "type" }}
|
|
|
|
{{ $src := index . "src" }}
|
|
|
|
{{ $alt := index . "alt" }}
|
|
|
|
|
|
|
|
{{ if index . "border" }}
|
2021-11-22 02:21:15 -06:00
|
|
|
<figure class="border">
|
2021-10-30 00:23:49 -05:00
|
|
|
{{ else }}
|
2021-11-22 02:21:15 -06:00
|
|
|
<figure>
|
2021-10-30 00:23:49 -05:00
|
|
|
{{ end }}
|
2021-11-22 02:21:15 -06:00
|
|
|
|
2021-10-30 00:23:49 -05:00
|
|
|
{{ if eq $type "image" }}
|
2023-11-05 00:56:13 -05:00
|
|
|
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
|
2021-10-30 00:23:49 -05:00
|
|
|
{{ else if eq $type "video" }}
|
2022-04-09 01:17:59 -05:00
|
|
|
<video controls preload="metadata">
|
2021-11-22 02:21:15 -06:00
|
|
|
<source src="{{ $src }}" alt="{{ $alt }}">
|
|
|
|
{{ i18n "browser_no_video_support" }}
|
|
|
|
</video>
|
2021-10-30 00:23:49 -05:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if not $hidecaption }}
|
2021-11-22 02:21:15 -06:00
|
|
|
{{ with $alt }}
|
|
|
|
<figcaption>
|
|
|
|
{{ . | markdownify }}
|
|
|
|
</figcaption>
|
|
|
|
{{ end }}
|
2021-10-30 00:23:49 -05:00
|
|
|
{{ end }}
|
|
|
|
</figure>
|