Use larger images for metadata
This commit is contained in:
parent
73bea50756
commit
3a7561d4a5
1 changed files with 2 additions and 2 deletions
|
@ -2,12 +2,12 @@
|
|||
{{ .Scratch.Set "image" .Params.image }}
|
||||
{{ if hasPrefix .Params.image "resource:" }}
|
||||
{{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }}
|
||||
{{ .Scratch.Set "image" ($resource.Fill "800x418").Permalink }}
|
||||
{{ .Scratch.Set "image" ($resource.Resize "800x").Permalink }}
|
||||
{{ else if hasPrefix .Params.image "unsplash:" }}
|
||||
{{ $unsplash_id := replace .Params.image "unsplash:" "" }}
|
||||
{{ $query := querify "client_id" (getenv "UNSPLASH_ACCESS_KEY") }}
|
||||
{{ $unsplash_data := (getJSON "https://api.unsplash.com/photos/" $unsplash_id "?" $query )}}
|
||||
{{ .Scratch.Set "image" $unsplash_data.urls.small }}
|
||||
{{ .Scratch.Set "image" $unsplash_data.urls.regular }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue