Add gallery.html, item.html, gallery-item.html
This commit is contained in:
26
layouts/partials/paige/gallery-item.html
Normal file
26
layouts/partials/paige/gallery-item.html
Normal 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>
|
Reference in New Issue
Block a user