Files
bobatheme/layouts/_partials/figure.html
BBaoVanC 1aa2f8ea5c Move template files based on Hugo v0.146 revamp
See https://gohugo.io/templates/new-templatesystem-overview/

Under layouts/
- mv _default/* .
- mv partials _partials
- mv shortcodes _shortcodes
- mv taxonomy/list.html taxonomy.html
- mv taxonomy/term.html term.html
2025-06-28 03:07:02 -05:00

29 lines
837 B
HTML

{{ $hidecaption := index . "hidecaption" }}
{{ if index . "noborder" }}
<figure>
{{ else }}
<figure class="border">
{{ end }}
{{ with index . "src" }}
{{ $media := . }}
{{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
{{ else if eq .MediaType.MainType "video" }}
<video controls preload="metadata">
<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>