[ci skip] Use webp instead of jpeg for thumbnails

This commit is contained in:
Luca Beltrame 2022-11-22 00:09:55 +01:00
parent 540ea51d8e
commit aa0ecc4104
Signed by: einar
GPG key ID: 4707F46E9EC72DEC
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{{ $image := resources.GetMatch (.Get "src") }} {{ $image := resources.GetMatch (.Get "src") }}
{{ $size := .Get "size" }} {{ $size := .Get "size" }}
{{/* Set the right options for Resize */}} {{/* Set the right options for Resize */}}
{{ $options := printf "%s %s %s" $size "jpg q90" "Box"}} {{ $options := printf "%s %s %s" $size "webp q90 drawing" "Lanczos"}}
{{ $imagethumbnail := $image.Resize $options }} {{ $imagethumbnail := $image.Resize $options }}
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}> <figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>

View file

@ -1,7 +1,7 @@
<div class="gallery flex justify-center"> <div class="gallery flex justify-center">
{{ range $param := .Params }} {{ range $param := .Params }}
{{ $image := resources.GetMatch ($param) }} {{ $image := resources.GetMatch ($param) }}
{{ $processed := $image.Resize ( printf "x%d %s %s %s" 350 "jpg" "q90" "Box" ) }} {{ $processed := $image.Resize ( printf "x%d %s %s %s %s" 350 "webp" "q90" "drawing" "Box" ) }}
<a href="{{ $image.RelPermalink }}"> <a href="{{ $image.RelPermalink }}">
<img class="thumbnail w6 pa1 mr1" src="{{ $processed.RelPermalink }}" style="width: 95% !important;" /> <img class="thumbnail w6 pa1 mr1" src="{{ $processed.RelPermalink }}" style="width: 95% !important;" />
</a> </a>