mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2026-05-01 04:40:22 -05:00
cc7cec07df
This reverts commit be12afb50d.
It causes issues with aspect ratio when the raw width of the image is
wider than the width in CSS pixels allowed by the body max-width.
Not reverting the refactor that removes {{ $img = . }} because I don't
know why that was there and will see if it works fine with it still
removed.
28 lines
781 B
HTML
28 lines
781 B
HTML
{{ $hidecaption := index . "hidecaption" }}
|
|
|
|
{{ if index . "noborder" }}
|
|
<figure>
|
|
{{ else }}
|
|
<figure class="border">
|
|
{{ end }}
|
|
|
|
{{ with index . "src" }}
|
|
{{ if eq .MediaType.MainType "image" }}
|
|
<img src="{{ .Permalink }}" alt="{{ .Title }}" loading="lazy" />
|
|
{{ else if eq .MediaType.MainType "video" }}
|
|
<video controls preload="metadata">
|
|
<source src="{{ .Permalink }}" alt="{{ .Title }}">
|
|
{{ i18n "browser_no_video_support" }}
|
|
</video>
|
|
{{ end }}
|
|
|
|
{{ if not $hidecaption }}
|
|
{{ with .Title }}
|
|
<figcaption>
|
|
{{ . | markdownify }}
|
|
</figcaption>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
</figure>
|