bobatheme/layouts/partials/figure.html

29 lines
822 B
HTML
Raw Permalink Normal View History

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