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

img src attribute #31

Open
brendanoffer opened this issue Oct 17, 2019 · 1 comment
Open

img src attribute #31

brendanoffer opened this issue Oct 17, 2019 · 1 comment

Comments

@brendanoffer
Copy link

Hi! Thanks for this repo, quick question.

Is there any way to add a src attribute to the <img /> tags rendered by Picture?. Is there a reason why you chose not to add or support it (opting for srcSet instead)?

We need the src attribute to satisfy SEO requirements.

@braposo
Copy link
Owner

braposo commented Oct 26, 2019

Hey @brendanoffer! Thanks for your question 😄

The reason why we don't use src is to avoid a double download if a browser doesn't support the <picture> element because we use picturefill to polyfill that behaviour. This is explained in this section https://github.com/scottjehl/picturefill#the-gotchas

Now this was decided 3 years ago when the amount of people still using IE was a lot more than it is today so I'm not completely against changing the behaviour to use src instead of srcSet.

In terms of SEO are you sure that really affects search engines? I know that srcSet support might still be a problem to some but it seems that for those crawlers picturefill will render the images correctly. This long discussion from 2015 seems to be relevant for this scottjehl/picturefill#549

Regardless, I don't oppose to making a change in the library for this.

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

2 participants