eleventy-img icon indicating copy to clipboard operation
eleventy-img copied to clipboard

Eleventy Transform: Use existing width attribute, if set

Open bamnet opened this issue 7 months ago • 1 comments

It's really neat how the eleventyImageTransformPlugin will automatically enhance img tags.

If an img tag already has a width attribute set, it would be helpful if the plugin used that value instead of requiring users to rename the attribute to eleventy:widths.

Example:

<img src="foo.jpg" width="600"> will return the full sized image. The transform plugin silently drops the width parameter. This is confusing and perhaps not what people expect (at least not what I expect).

<img src="foo.jpg" eleventy:widths="600"> fixes it.

bamnet avatar Jul 16 '24 04:07 bamnet