bobatheme/layouts/partials/remote_figure.html
2023-11-05 00:56:13 -05:00

29 lines
716 B
HTML

{{ $hidecaption := index . "hidecaption" }}
{{ $type := index . "type" }}
{{ $src := index . "src" }}
{{ $alt := index . "alt" }}
{{ if index . "border" }}
<figure class="border">
{{ else }}
<figure>
{{ end }}
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
{{ else if eq $type "video" }}
<video controls preload="metadata">
<source src="{{ $src }}" alt="{{ $alt }}">
{{ i18n "browser_no_video_support" }}
</video>
{{ end }}
{{ if not $hidecaption }}
{{ with $alt }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
{{ end }}
</figure>