From 6cc65c1ff21e07f5238c80766255ca28ffab0d48 Mon Sep 17 00:00:00 2001 From: Simon C Date: Tue, 8 Apr 2025 10:42:34 +0200 Subject: [PATCH] feat: Modification des tailles des images et de l'affichage de la vignette mise en avant --- assets/styles/posts.sass | 5 ++++- layouts/actualites/single.html | 10 +++++----- layouts/partials/article-preview.html | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/styles/posts.sass b/assets/styles/posts.sass index dd8e222..0f7c7ce 100644 --- a/assets/styles/posts.sass +++ b/assets/styles/posts.sass @@ -28,11 +28,14 @@ $size-news: 100px width: $size-la-une height: $size-la-une @media screen and (max-width: $size-sm) + background: white width: 100% overflow: hidden margin: 0 img - width: 100% + width: auto + margin: 0 auto + max-height: 100% .details padding: 20px background: var(--color-grey) diff --git a/layouts/actualites/single.html b/layouts/actualites/single.html index ea36dc5..783464a 100644 --- a/layouts/actualites/single.html +++ b/layouts/actualites/single.html @@ -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 }}