
Documentation
Generated by Codox
Tolgraven 0.1.0-SNAPSHOT
website.components.image.sources
Shared format selection for rendered pictures and server preloads.
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.
replace-extension
(replace-extension path new-ext)Replace file extension. e.g., ‘img/foo.jpg’ -> ‘img/foo.webp’
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)