From 83726ed04008f8a5d5a28d722ca9483ab915dae6 Mon Sep 17 00:00:00 2001 From: Brummel Date: Thu, 21 May 2026 12:31:47 +0200 Subject: [PATCH] feat(hero): responsive srcset for carousel slides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phones were downloading the full 1.5 MB / 2 MB hero JPEG. Now the image macro emits a `srcset` ladder (480/768/1200/1600/2560/3840/5345 w) with `sizes="100vw"`, so a 480 px-wide phone picks the ~19 KB variant and 5K screens still get the native resolution. Also drop `loading="lazy"` on the first slide — it is the LCP element and should load eager. Macro changes: - Add `srcset_widths` (CSV string, since Tera macros only allow scalar defaults) and `sizes` parameters. - Add `lazy=true` parameter; callers can pass `lazy=false` for above-the-fold images. Co-Authored-By: Claude Opus 4.7 (1M context) --- templates/index.html | 17 +++++++++++----- templates/macros/image.html | 39 +++++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/templates/index.html b/templates/index.html index 62ff10b..6985bc8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,11 +16,18 @@