Summary
Ship <picture> / <img srcset sizes> helpers per doc 07 §6. Two implementations needed: a Go server-side helper for theme/block render functions (RenderImage), and a JS mirror for client-rendered blocks. Helpers emit explicit AVIF/WebP/JPEG sources, set width/height from the original aspect (CLS=0), inline the blurhash as a base64 SVG background-image, and add loading="lazy" decoding="async" unless priority is set.
Design reference
- docs/07-media-performance.md §6.1, §6.2
Acceptance criteria
Dependencies
#image-proxy
Complexity
M
Summary
Ship
<picture>/<img srcset sizes>helpers per doc 07 §6. Two implementations needed: a Go server-side helper for theme/block render functions (RenderImage), and a JS mirror for client-rendered blocks. Helpers emit explicit AVIF/WebP/JPEG sources, setwidth/heightfrom the original aspect (CLS=0), inline the blurhash as a base64 SVGbackground-image, and addloading="lazy" decoding="async"unlesspriorityis set.Design reference
Acceptance criteria
RenderImage(m Media, opts ImageOpts) template.HTMLships in renderer packageimage(m: Media, opts: ImageOpts): JSX.Elementships for client blocks<picture>with AVIF + WebP + JPEG<source>elementssrcsetwidths follownext.config.jsdeviceSizesandimageSizesdefaultswidth/heightattrs match original aspect — Lighthouse CLS = 0data:image/svg+xml;base64,...background-imageloading="lazy"default;priorityopts into eager loadingimage-loader.js) returns/img/{id}/w_{w},q_{q},fmt_autoDependencies
#image-proxy
Complexity
M