diff options
-rw-r--r-- | layouts/partials/leading_image.html | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/layouts/partials/leading_image.html b/layouts/partials/leading_image.html index 2f8e491..1b5cf28 100644 --- a/layouts/partials/leading_image.html +++ b/layouts/partials/leading_image.html @@ -8,12 +8,13 @@ <div class="text-center"> <div class="relative inline-block"> <img - src="{{ if ne .MediaType.SubType "svg" }} - {{ $image := .Fit (default "768x400" $.Params.image_size) }} - {{ $image.RelPermalink }} + {{ if ne .MediaType.SubType "svg" }} + {{ $image := .Fit (default "768x400 webp" $.Params.image_size) }} + width="{{ $image.Width }}" height="{{ $image.Height }}" + src="{{ $image.RelPermalink }}" {{ else }} - {{ $image.RelPermalink }} - {{ end }}" + src="{{ $image.RelPermalink }}" + {{ end }} class="m-0" alt="{{ .Title }}" /> |