tell the browser how wide a picture will be

srcset without sizes means a browser assumes 100vw, so a gallery thumbnail in a
16rem column was fetching the 1600px original — the derivative pass was costing
bandwidth on the page it exists to save it on. It now picks the 480w variant.

sizes is the one part of responsive images the engine cannot supply: it states
how wide the picture will *be*, which is a fact about the layout and therefore
the theme's. The reference theme states its own measure and nothing more.

Lazy loading goes on gallery entries and not on a figure, because a figure is
often the first thing on the page and deferring it delays what the reader came
for. Both have demo cases, including that the figure is *not* deferred.

Queue entry G2, which had been sitting unfixed through the whole Markdown arc.
This commit is contained in:
Claude Opus 5
2026-08-01 23:18:59 +06:00
committed by bdeshi
parent 7136f6e2d9
commit ccce537ae4
6 changed files with 36 additions and 4 deletions
+4
View File
@@ -116,6 +116,10 @@ var exampleFeatures = []featureCase{
expect: []string{"First Rain", "The Flood", "Aftermath", "What Remained"}},
{what: "a chapter has neighbours, a position, and the ends", path: "/comics/the-long-monsoon/the-flood/", code: 200,
expect: []string{`rel="prev"`, `rel="next"`, "2 of 4", `class="ends"`}},
{what: "generated widths come with a sizes hint, and thumbnails load lazily", path: "/art/monsoon-studies/", code: 200,
expect: []string{`sizes="(min-width: 36rem) 16rem, 100vw"`, `loading="lazy"`, `decoding="async"`}},
{what: "a lead figure is sized for the measure and never deferred", path: "/posts/first-light/", code: 200,
expect: []string{`sizes="(min-width: 36rem) 32rem, 100vw"`}, absent: []string{`loading="lazy"`}},
{what: "a gallery sizes what it can and leaves alone what it cannot", path: "/art/monsoon-studies/", code: 200,
expect: []string{`class="gallery"`, "10-grey.jpg", "srcset=", `src="40-line.svg"`},
absent: []string{`src="40-line.svg" srcset`}},