Add gallery.html, item.html, gallery-item.html

This commit is contained in:
Will Faught
2023-01-02 11:12:47 -08:00
parent e6f7299c71
commit ccd677538c
5 changed files with 155 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
{{ $image := .image }}
{{ $caption := .caption }}
{{ $method := .method }}
{{ $options := .options }}
{{ $thumbnail := $image }}
{{ with $image }}
{{ if eq $method "crop" }}
{{ $thumbnail = .Crop $options }}
{{ else if eq $method "fill" }}
{{ $thumbnail = .Fill $options }}
{{ else if eq $method "fit" }}
{{ $thumbnail = .Fit $options }}
{{ else if eq $method "resize" }}
{{ $thumbnail = .Resize $options }}
{{ end }}
{{ end }}
<figure class="d-table mb-0">
<a href="{{ $image.RelPermalink }}">
<img class="{{ if $caption }}figure-img {{ end }}img-fluid" loading="lazy" src="{{ $thumbnail.RelPermalink }}">
</a>
{{ with $caption }}
<figcaption class="figure-caption text-center" style="display: table-caption; caption-side: bottom">{{ . }}</figcaption>
{{ end }}
</figure>