diff options
Diffstat (limited to 'layouts/partials/content/card-image.html')
-rw-r--r-- | layouts/partials/content/card-image.html | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/layouts/partials/content/card-image.html b/layouts/partials/content/card-image.html index c20f2da..7a3a43e 100644 --- a/layouts/partials/content/card-image.html +++ b/layouts/partials/content/card-image.html @@ -1,4 +1,4 @@ -{{ $fillImage := .Scratch.Get "fillImage" }} +{{ $fillImage := .Scratch.Get "fillImageCard" }} {{ if not $fillImage -}} {{ $fillImage = site.Params.fillImage }} {{ end -}} @@ -8,7 +8,15 @@ {{ $image = resources.Get (printf "%s%s" "images/" site.Params.defaultImage) }} {{ end -}} -{{ $image = $image.Fill $fillImage }} +{{ $webp := printf "%s%s" $fillImage " webp" }} +{{ $image = $image.Resize $webp}} + {{ $lqip := $image.Resize site.Params.lqipWidth -}} -<img class="card-img-top img-fluid lazyload blur-up" src="{{ $lqip.Permalink }}" data-src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ .Title }}"> +<img + class="card-img-top img-fluid lazyload blur-up" + src="{{ $lqip.Permalink }}" + data-src="{{ $image.Permalink }}" + width="{{ $image.Width }}" + height="{{ $image.Height }}" + alt="{{ .Title }}"> |