refactor: use .Fill for cover image

This commit is contained in:
Jimmy Cai 2020-12-23 20:54:15 +01:00
parent d9bec10b49
commit f121999ecf
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18

View File

@ -10,8 +10,8 @@
{{- $Srcset := "" -}}
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
{{- $thumbnail := $image.resource.Fill "800x250" -}}
{{- $thumbnailRetina := $image.resource.Fill "1600x500" -}}
{{- $thumbnail := $image.resource.Resize "800x" -}}
{{- $thumbnailRetina := $image.resource.Resize "1600x" -}}
{{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}}
{{- $Permalink = $thumbnail.RelPermalink -}}
{{- $Width = $thumbnail.Width -}}