Documentation

website.components.image.sources

Shared format selection for rendered pictures and server preloads.

dimensions

(dimensions src)(dimensions src asset)

get-src-variants

(get-src-variants src)(get-src-variants src asset)

Get all available format variants for an image path. Returns a map with :original, :webp, and :avif paths. Useful for preloading or manual format selection.

placeholder-background

(placeholder-background src)(placeholder-background src asset)

Fixed vertical gradient from codec-owned, validated three-row color samples. Invalid or unavailable metadata has no CSS representation.

preview

(preview src)(preview src asset)

Smallest catalog candidate for a progressive image. Sized local renditions preserve responsive source selection independently of progressive display.

progressive?

(progressive? src)(progressive? src asset)

replace-extension

(replace-extension path new-ext)

Replace file extension. e.g., ‘img/foo.jpg’ -> ‘img/foo.webp’

responsive

should-use-modern-formats?

(should-use-modern-formats? src)(should-use-modern-formats? src asset)

Determine if we should generate modern format sources for this image. Skip for: - SVG files (already vector-based) - External URLs other than our versioned, converted Supabase avatars - URLs with query strings (likely already proxied/optimized) - Favicons and app icons - Uncatalogued modern formats (WebP, AVIF)

srcset

(srcset src format)(srcset src format asset)