2021-10-27 09:48:13 -05:00
|
|
|
{{ $hidecaption := index . "hidecaption" }}
|
|
|
|
|
2021-11-10 21:46:07 -06:00
|
|
|
{{ if index . "noborder" }}
|
2021-11-22 02:21:15 -06:00
|
|
|
<figure>
|
2021-11-10 21:46:07 -06:00
|
|
|
{{ else }}
|
2021-11-22 02:21:15 -06:00
|
|
|
<figure class="border">
|
2021-10-27 09:48:13 -05:00
|
|
|
{{ end }}
|
2021-10-19 14:19:23 -05:00
|
|
|
|
2021-11-22 02:21:15 -06:00
|
|
|
{{ with index . "src" }}
|
|
|
|
{{ $media := . }}
|
|
|
|
{{ if eq .MediaType.MainType "image" }}
|
2023-11-05 00:56:13 -05:00
|
|
|
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
|
2021-11-22 02:21:15 -06:00
|
|
|
{{ else if eq .MediaType.MainType "video" }}
|
2022-04-09 01:17:59 -05:00
|
|
|
<video controls preload="metadata">
|
2021-11-22 02:21:15 -06:00
|
|
|
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
|
|
|
{{ i18n "browser_no_video_support" }}
|
|
|
|
</video>
|
|
|
|
{{ end }}
|
2021-10-27 09:48:13 -05:00
|
|
|
|
2021-11-22 02:21:15 -06:00
|
|
|
{{ if not $hidecaption }}
|
|
|
|
{{ with $media.Title }}
|
|
|
|
<figcaption>
|
|
|
|
{{ . | markdownify }}
|
|
|
|
</figcaption>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2021-10-27 09:48:13 -05:00
|
|
|
{{ end }}
|
2021-10-19 14:19:23 -05:00
|
|
|
</figure>
|