bobatheme/layouts/partials/remote_figure.html

29 lines
701 B
HTML
Raw Normal View History

2021-10-30 00:23:49 -05:00
{{ $hidecaption := index . "hidecaption" }}
{{ $type := index . "type" }}
{{ $src := index . "src" }}
{{ $alt := index . "alt" }}
{{ if index . "border" }}
<figure class="border">
2021-10-30 00:23:49 -05:00
{{ else }}
<figure>
2021-10-30 00:23:49 -05:00
{{ end }}
2021-10-30 00:23:49 -05:00
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" />
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">
<source src="{{ $src }}" alt="{{ $alt }}">
{{ i18n "browser_no_video_support" }}
</video>
2021-10-30 00:23:49 -05:00
{{ end }}
{{ if not $hidecaption }}
{{ with $alt }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
2021-10-30 00:23:49 -05:00
{{ end }}
</figure>