mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-17 21:25:59 -06:00
28 lines
621 B
HTML
28 lines
621 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 }}" />
|
||
|
{{ else if eq $type "video" }}
|
||
|
<video controls>
|
||
|
<source src="{{ $src }}" alt="{{ $alt }}">
|
||
|
{{ i18n "browser_no_video_support" }}
|
||
|
</video>
|
||
|
{{ end }}
|
||
|
|
||
|
{{ if not $hidecaption }}
|
||
|
{{ with $alt }}
|
||
|
<figcaption>
|
||
|
{{ . | markdownify }}
|
||
|
</figcaption>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
</figure>
|