Convert images to webp
This commit is contained in:
parent
c4fec2ebac
commit
0f59b43766
4 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
|||
{{ $resource := .Page.Resources.GetMatch $destination }}
|
||||
|
||||
{{ if $resource }}
|
||||
{{ $destination = ($resource.Resize "1500x").RelPermalink }}
|
||||
{{ $destination = ($resource.Resize "1500x webp").RelPermalink }}
|
||||
{{ end }}
|
||||
|
||||
<figure class="text-center">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ define "main" }}
|
||||
|
||||
{{ $header_image := (resources.Get "img/header.jpg" | fingerprint).Resize "1500x" }}
|
||||
{{ $header_image := (resources.Get "img/header.jpg" | fingerprint).Resize "1500x webp" }}
|
||||
<header id="index-header" class="d-flex align-items-center" style="background-image: url({{ $header_image.RelPermalink }})">
|
||||
<div class="text-center m-auto text-light">
|
||||
<h1 class="display-1">{{ .Site.Params.author_name }}</h1>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{ .Scratch.Set "image" .Params.image }}
|
||||
{{ if hasPrefix .Params.image "resource:" }}
|
||||
{{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }}
|
||||
{{ .Scratch.Set "image" ($resource.Resize "2000x").RelPermalink }}
|
||||
{{ .Scratch.Set "image" ($resource.Resize "2000x webp").RelPermalink }}
|
||||
{{ else if hasPrefix .Params.image "unsplash:" }}
|
||||
{{ $unsplash_id := replace .Params.image "unsplash:" "" }}
|
||||
{{ $query := querify "client_id" (getenv "UNSPLASH_ACCESS_KEY") }}
|
||||
|
|
|
@ -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").RelPermalink }}
|
||||
{{ .Scratch.Set "image" ($resource.Resize "500x webp").RelPermalink }}
|
||||
{{ else if hasPrefix .Params.image "unsplash:" }}
|
||||
{{ $unsplash_id := replace .Params.image "unsplash:" "" }}
|
||||
{{ $query := querify "client_id" (getenv "UNSPLASH_ACCESS_KEY") }}
|
||||
|
|
Loading…
Reference in a new issue