feat: Don't Resize svg file

This commit is contained in:
Simon 2022-03-03 09:31:43 +01:00
parent 7dd4dbfd3c
commit cdb7e47a88
1 changed files with 2 additions and 0 deletions

View File

@ -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" />