8 lines
483 B
HTML
8 lines
483 B
HTML
{{- $thumbnailResource := .Resources.GetMatch (index .Page.Params "thumbnail")
|
|
| default (index (.Page.Resources.ByType "image") 0) -}}
|
|
{{- if not $thumbnailResource -}}
|
|
{{- errorf "No thumbnail available for %s" .Page.Permalink }}
|
|
{{- end -}}
|
|
{{- $orientation := partial "images/orientation_angle.html" $thumbnailResource -}}
|
|
{{- $thumbnail := $thumbnailResource.Fit (printf "%dx%d r%d" .Width .Height (sub 360 $orientation)) -}}
|
|
{{ return $thumbnail }}
|