You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
855 B
HTML

{{ $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>