mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-05 08:25:59 -06:00
30 lines
678 B
HTML
30 lines
678 B
HTML
{{ $hidecaption := index . "hidecaption" }}
|
|
|
|
{{ if index . "border" }}
|
|
<figure class="border">
|
|
{{ else }}
|
|
<figure>
|
|
{{ end }}
|
|
{{ with index . "src" }}
|
|
|
|
{{ $media := . }}
|
|
{{ if eq .MediaType.MainType "image" }}
|
|
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
|
|
{{ else if eq .MediaType.MainType "video" }}
|
|
<video controls>
|
|
<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>
|