Skip to content

Eleventy Transform: Use existing width attribute, if set #234

@bamnet

Description

@bamnet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeThis will have to be included with a major version as it breaks backwards compatibility.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions