From 87d8c05eb25b48341bd14c445d41c89dfbac396f Mon Sep 17 00:00:00 2001 From: Hoernschen Date: Sat, 13 Jan 2024 17:35:12 +0100 Subject: [PATCH] FIX browser image selection --- layouts/partials/components/image.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/layouts/partials/components/image.html b/layouts/partials/components/image.html index 4e45c45..a85b628 100644 --- a/layouts/partials/components/image.html +++ b/layouts/partials/components/image.html @@ -2,6 +2,8 @@ type: string - default url: string alt: string +width: int +height: int --> {{ $avatar := "avatar"}} {{ $sizes := slice "320" "640" "960" "1280" }} @@ -16,7 +18,7 @@ alt: string {{ range $i, $size := $sizes }} {{ $dir }}/{{ $name }}-{{ $size }}{{ $ext }}.avif {{ $size }}w, {{ end }} - {{ .url }}.avif + {{ .url }}.avif {{ .width }}w " /> {{ .alt }}