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
|
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) }}
|
{{ $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) }}
|
{{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }}
|
||||||
{{ with $image }}
|
{{ with $image }}
|
||||||
{{ $maxWidth := (default "610" site.Params.ImageWidth) }}
|
{{ $maxWidth := (default "610" site.Params.ImageWidth) }}
|
||||||
|
@ -12,4 +13,5 @@
|
||||||
{{ $path = $resized.RelPermalink }}
|
{{ $path = $resized.RelPermalink }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ 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" />
|
||||||
|
|
Loading…
Reference in New Issue