Use the photo_thumbnail partial in the li_thumbnail_in_grid template

This commit is contained in:
Eryn Wells 2022-11-03 17:03:57 -07:00
parent 0f47ca61a6
commit 1e6711b8f3

View file

@ -1,9 +1,6 @@
{{- $thumbnailResource := .Resources.GetMatch (index .Params "thumbnail")
| default (index (.Resources.ByType "image") 0) -}}
{{- $orientation := partial "images/orientation_angle.html" $thumbnailResource -}}
{{- $thumbnail := $thumbnailResource.Fit (printf "%dx%d r%d" 600 600 (sub 360 $orientation)) -}}
{{- $thumbnail := partial "images/photo_thumbnail.html" (dict "Page" . "Width" 600 "Height" 600) -}}
{{- $thumbnail = $thumbnail.Crop "600x600" -}}
{{- $altText := $thumbnailResource.Params.alt -}}
{{- $altText := $thumbnail.Params.alt -}}
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
<img src="{{ $thumbnail.RelPermalink }}" {{ with $altText }}alt="{{ . }}"{{ end }}>
</a>