feat: Ne pas déformer les photos
This commit is contained in:
@ -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 }}
|
||||
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} loading="lazy" />
|
||||
|
Reference in New Issue
Block a user