Documentation
¶
Overview ¶
Command srcset builds a responsive srcset for every image from its src, a width list and an image CDN template.
srcset -widths 320,640,1280 -cdn '/cdn?u={url}&w={w}' < page.html > out.html
An image that already has a srcset is left alone. One with no width to size against gets a sizes attribute only if the caller supplied one, because guessing a layout is how a responsive image ends up loading the wrong file.
ESI parsing is on by default. These pages are usually assembled at the edge, so they contain <esi:include> tags written without a self-closing slash, and without -esi=false those are treated as containers rather than void elements: replacing or removing one then swallows the enclosing element's end tag. The symptom is malformed output rather than an error, which is why this defaults the other way from the library.