srcset

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL