Get thumbnails oriented the right way before resizing
This commit is contained in:
parent
397c2262be
commit
1200833ef3
1 changed files with 6 additions and 7 deletions
|
@ -1,10 +1,9 @@
|
|||
{{- $thumbnailResource := .Resources.GetMatch (index .Params "thumbnail")
|
||||
| default (index (.Resources.ByType "image") 0) -}}
|
||||
{{- $thumbnail := $thumbnailResource.Fit "600x600" -}}
|
||||
{{- $thumbnail := $thumbnail.Crop "600x600" -}}
|
||||
{{- $orientation := partial "images/orientation_angle.html" $thumbnailResource -}}
|
||||
{{- $thumbnail := $thumbnailResource.Fit (printf "%dx%d r%d" 600 600 (sub 360 $orientation)) -}}
|
||||
{{- $thumbnail = $thumbnail.Crop "600x600" -}}
|
||||
{{- $altText := $thumbnailResource.Params.alt -}}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
|
||||
<img src="{{ $thumbnail.RelPermalink }}" {{ with $altText }}alt="{{ . }}"{{ end }}>
|
||||
</a>
|
||||
</li>
|
||||
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
|
||||
<img src="{{ $thumbnail.RelPermalink }}" {{ with $altText }}alt="{{ . }}"{{ end }}>
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue