Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
saneef opened this issue Jul 9, 2021 · 1 comment

Comments

@saneef
Copy link
Contributor

saneef commented Jul 9, 2021

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?

@saneef
Copy link
Contributor Author

saneef commented Jul 9, 2021

Or, transform all <img> without any classes by default. Then, the <img> with classes need to be explicitly opted in like <img class="resp w-full" .../> or <img data-local-respimg="true" class="w-full" .../>

Any other ideas? I can create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant