From 345f91e045c1a7f2f91fd8be7a3c4bee67186967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Tue, 28 Apr 2026 20:51:17 +0200 Subject: [PATCH] feat: use img.html partial for hero banner (WebP + srcset) and update CSS Co-Authored-By: Claude Sonnet 4.6 --- layouts/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/index.html b/layouts/index.html index 485af81..c7af6ae 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -12,13 +12,19 @@ {{- $heroBanner := .Resources.GetMatch "banner.png" -}} {{- if not $heroBanner -}}{{- $heroBanner = .Resources.GetMatch "banner.*" -}}{{- end -}} + {{- if $heroBanner -}} +
+ {{- partial "img.html" (dict "res" $heroBanner "widths" (slice 1200 1920 2560) "sizes" "100vw" "class" "w-full h-full object-cover" "alt" "" "loading" "eager") -}} +
+ {{- else -}} {{- $heroBannerSrc := "" -}} - {{- with $heroBanner }}{{ $heroBannerSrc = .RelPermalink }}{{ else }}{{ with $.Params.background }}{{ $heroBannerSrc = .src }}{{ else }}{{ with $.Params.banner }}{{ $heroBannerSrc = .src }}{{ end }}{{ end }}{{ end -}} + {{- with .Params.background }}{{ $heroBannerSrc = .src }}{{ else }}{{ with $.Params.banner }}{{ $heroBannerSrc = .src }}{{ end }}{{ end -}} {{- with $heroBannerSrc -}}
{{- end -}} + {{- end -}}