mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-12 09:47:29 -05:00
Improve figures
- Add option to disable border and caption
This commit is contained in:
@ -1,4 +1,12 @@
|
||||
{{ $hidecaption := index . "hidecaption" }}
|
||||
|
||||
{{ if index . "border" }}
|
||||
<figure class="border">
|
||||
{{ else }}
|
||||
<figure>
|
||||
{{ end }}
|
||||
{{ with index . "src" }}
|
||||
|
||||
{{ $media := . | resources.Fingerprint "sha512" }}
|
||||
{{ if eq .MediaType.MainType "image" }}
|
||||
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
|
||||
@ -9,9 +17,13 @@
|
||||
</video>
|
||||
{{ end }}
|
||||
|
||||
{{ if not $hidecaption }}
|
||||
{{ with $media.Title }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</figure>
|
||||
|
Reference in New Issue
Block a user