From 0a3ceec95d72d93063f5a0610003c4de462a7516 Mon Sep 17 00:00:00 2001 From: Simon C Date: Thu, 4 May 2023 16:53:38 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Ne=20pas=20d=C3=A9former=20les=20photos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/styles/main.sass | 2 -- layouts/_default/_markup/render-image.html | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/styles/main.sass b/assets/styles/main.sass index 3c01442..e066ce1 100644 --- a/assets/styles/main.sass +++ b/assets/styles/main.sass @@ -52,8 +52,6 @@ body margin: 1rem -1rem @media screen and (max-width: $size-xs) margin: 1rem -.5rem - img - width: 100% .round border-radius: 100% diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index f3a9545..33ee52a 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -4,7 +4,8 @@ {{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }} {{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }} {{ with $image }} - {{ $resized := $image.Resize "960x q100 webp" }} + {{ $width := cond (gt .Width 960) 960 .Width }} + {{ $resized := $image.Resize (printf "%sx q100 webp" (string $width)) }} {{ $path = $resized.RelPermalink }} {{ end }} {{ .Text }}