feat: Modification des tailles des images et de l'affichage de la vignette mise en avant
This commit is contained in:
@ -7,12 +7,12 @@
|
||||
{{ $height := 534 }}
|
||||
{{ $image := default ($headless.Resources.GetMatch "**.jpg") (.Resources.GetMatch (default "**.jpg" .Params.image)) }}
|
||||
{{ if $image }}
|
||||
{{ if and (ge $image.Width $widthOriginal) (ge $image.Height $heightOriginal) }}
|
||||
{{ $image = $image.Process (printf "fill %dx%d Center webp" $width $height) }}
|
||||
{{ else if gt $image.Height $height }}
|
||||
{{ $image = $image.Process (printf "resize x%d webp" $height) }}
|
||||
{{ if and (ge $image.Width $widthOriginal) (ge $image.Height $heightOriginal) }}
|
||||
{{ $image = $image.Process (printf "fill %dx%d Center webp" $width $height) }}
|
||||
{{ else if gt $image.Height $height }}
|
||||
{{ $image = $image.Process (printf "resize x%d webp" $height) }}
|
||||
{{ else }}
|
||||
{{ $image = $image.Process "webp" }}
|
||||
{{ $image = $image.Process "webp" }}
|
||||
{{ end }}
|
||||
<img
|
||||
class="hero no-print"
|
||||
|
Reference in New Issue
Block a user