feat: Ne pas déformer les photos
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is passing Details

This commit is contained in:
Simon 2023-05-04 16:53:38 +02:00
parent a7d3ac01e9
commit 0a3ceec95d
2 changed files with 2 additions and 3 deletions

View File

@ -52,8 +52,6 @@ body
margin: 1rem -1rem margin: 1rem -1rem
@media screen and (max-width: $size-xs) @media screen and (max-width: $size-xs)
margin: 1rem -.5rem margin: 1rem -.5rem
img
width: 100%
.round .round
border-radius: 100% border-radius: 100%

View File

@ -4,7 +4,8 @@
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }} {{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }}
{{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }} {{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }}
{{ with $image }} {{ 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 }} {{ $path = $resized.RelPermalink }}
{{ end }} {{ end }}
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} loading="lazy" /> <img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} loading="lazy" />