Improve figures

- Add option to disable border and caption
This commit is contained in:
2021-10-27 09:48:13 -05:00
parent 0cfecdab18
commit 7ffa6c068c
5 changed files with 29 additions and 4 deletions

View File

@ -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>