Skip to content

[eleventy-plugin-local-respimg] Right way to exclude certain images or files #79

@saneef

Description

@saneef

Currently, the plug will transform all <img> in an Eleventy project into <picture><img/><picture> tags. This may not be desirable for some images:

  • ...that are used for UI. After respimg transform styles may break.
  • ...<img> already have srcset attribute set.

What would be an ideal way to exclude such images? I made an attempt to exclude through outputPath regex. But then realized, UI images will be present in all the pages. How can we exclude them?

Should we do class or data attribute based filtering? Ex. <img class="no-resp" ...> will not be touched?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions