Skip to content

Conversation

@moebrowne
Copy link

This PR adds lazy loading to images site wide

@tdelmas
Copy link
Collaborator

tdelmas commented Dec 20, 2020

Thank you for that contribution.

Could you add a comment with more information about:

  • Why this change is useful
  • Where/When loading="lazy" should be added

As I see it, it may be useful for pages with a lot of small images outside of the screen on the first load, or for pages with heavy images, right?
Or is it better to apply it to every images?

Documentation: https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#Images_and_iframes

Also, the build fail because the html validator apparently doesn't know that tag: validator/validator#811
That must be solved one way or another.

According to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img most modern browsers support the loading attribute.

image

image

@tdelmas
Copy link
Collaborator

tdelmas commented Nov 13, 2021

Thank you again @moebrowne for your contribution. I've open #1355 to automatically add loading=lazy to the content of all pages (not the full page, only then content).

I'll close this PR but do not hesitate to comment again here or on the other.

@tdelmas tdelmas closed this Nov 13, 2021
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

Successfully merging this pull request may close these issues.

2 participants