1
Fork 0

Reduce size of images on list page

It maxes out at ~220 anyway, and 200 is how large the unsplash images are anyway
This commit is contained in:
Jake Howard 2022-01-03 14:52:13 +00:00
parent 68ef4341a0
commit 73bea50756
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -5,7 +5,7 @@
{{ .Scratch.Set "image" .Params.image }}
{{ if hasPrefix .Params.image "resource:" }}
{{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }}
{{ .Scratch.Set "image" ($resource.Resize "500x webp").RelPermalink }}
{{ .Scratch.Set "image" ($resource.Resize "200x webp").RelPermalink }}
{{ else if hasPrefix .Params.image "unsplash:" }}
{{ $unsplash_id := replace .Params.image "unsplash:" "" }}
{{ $query := querify "client_id" (getenv "UNSPLASH_ACCESS_KEY") }}