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

Support for Native Lazy Loading of Images #2910

Closed
angusmcb opened this issue May 11, 2020 · 5 comments
Closed

Support for Native Lazy Loading of Images #2910

angusmcb opened this issue May 11, 2020 · 5 comments

Comments

@angusmcb
Copy link
Contributor

Native lazy loading of images is now supported in chrome and firefox.
https://caniuse.com/#feat=loading-lazy-attr

Would it be possible to support this in Grav? Possibly even setting it as the default for all images inserted through markdown?

Thanks!

@rhukster
Copy link
Member

This has been added to latest 1.7 branch.

@juliendude
Copy link

Pretty cool this simple yet powerful browser native feature has been added as a config in Grav.
Sometimes, something little and simple can go a long way :)

@angusmcb
Copy link
Contributor Author

That is great :-)

Another related suggestion is to include the height="" and width="" properties, so there is no possibility of jank when lazy loading (I understand it also stops jank even when not lazy loading).

I realise that might be more difficult, as you would need to know the image file width and height.

@01Kuzma
Copy link

01Kuzma commented Sep 22, 2020

That's strange. I've upgraded to 1.7 RC16 and Admin Panel v1.9.16, but these lines are missing in blueprints/config/system.yaml:

            images.defaults.loading:
              type: select
              size: small
              label: PLUGIN_ADMIN.IMAGES_LOADING
              help: PLUGIN_ADMIN.IMAGES_LOADING_HELP
              highlight: auto
              options:
                auto: Auto
                lazy: Lazy
                eager: Eager

@mahagr mahagr reopened this Sep 22, 2020
@mahagr
Copy link
Member

mahagr commented Sep 22, 2020

I just checked and the lines are there:
https://github.com/getgrav/grav/blob/1.7/system/blueprints/config/system.yaml#L1135-L1144

PS. Update your admin plugin to 1.10 as well!

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

No branches or pull requests

5 participants