feat: Don't Resize svg file
This commit is contained in:
parent
7dd4dbfd3c
commit
cdb7e47a88
|
@ -3,6 +3,7 @@
|
|||
S'il n'y a pas de / dans l'url d'une image alors on ajoute le path de l'article
|
||||
*/}}
|
||||
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }}
|
||||
{{ if ne (substr $path -3 3) "svg" }}
|
||||
{{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }}
|
||||
{{ with $image }}
|
||||
{{ $maxWidth := (default "610" site.Params.ImageWidth) }}
|
||||
|
@ -12,4 +13,5 @@
|
|||
{{ $path = $resized.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} loading="lazy" />
|
||||
|
|
Loading…
Reference in New Issue