bobatheme/layouts/partials/remote_figure.html

29 lines
682 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" }}
<video controls>
<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>