docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.06k stars 5.65k forks source link

Support browser-level lazy-loading for images #1431

Open oeway opened 3 years ago

oeway commented 3 years ago

Feature request

Support lazy-loading images Reference: https://web.dev/browser-level-image-lazy-loading/

What problem does this feature solve?

For pages with many images, instead of loading all the images, using lazy-loading will allow the browser fetch images on demand.

What does the proposed API look like?

I think we can expose an lazy loading option, or enable it by default.

How should this be implemented in your opinion?

Add loading=lazy to img tags.

Are you willing to work on this yourself?

Not sure where to change.

jhildenbiddle commented 3 years ago

Let's update the title to "Support lazy-loading of images" since we don't want to dictate an implementation.

Things to consider:

sy-records commented 4 months ago

I provide a plugin https://github.com/sy-records/docsify-loading