2020-11-09 12:36:28 +01:00
|
|
|
{{/*
|
|
|
|
S'il n'y a pas de / dans l'url d'une image alors on ajoute le path de l'article
|
|
|
|
*/}}
|
2021-06-20 22:19:59 +02:00
|
|
|
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }}
|
|
|
|
{{ $image := .Page.Resources.GetMatch (printf "*%s*" .Destination) }}
|
|
|
|
{{ with $image }}
|
2023-05-04 16:38:31 +02:00
|
|
|
{{ $resized := $image.Resize "960x q100 webp" }}
|
2021-06-20 22:19:59 +02:00
|
|
|
{{ $path = $resized.RelPermalink }}
|
|
|
|
{{ end }}
|
|
|
|
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} loading="lazy" />
|