Integration of lazysizes, a lightweight lazy loader, into Plone.
Project description
Life, the Universe, and Everything
This package integrates lazysizes, a lightweight lazy loader, into Plone.
lazysizes is a fast, SEO-friendly and self-initializing lazyloader for images (including responsive images picture/srcset), iframes, scripts/widgets and much more. It also prioritizes resources by differentiating between crucial in view and near view elements to make perceived performance even faster.
By using this package you can expect reductions of up to 80% in load time, 75% in page size and 50% in number of requests.
Mostly Harmless
These are some sites using collective.lazysizes:
CartaCapital (BR)
Conversa Afiada (BR)
Portal Brasil 2016 (BR)
Got an idea? Found a bug? Let us know by opening a support ticket.
Don’t Panic
Installation
To enable this package in a buildout-based installation:
Edit your buildout.cfg and add add the following to it:
[buildout] ... eggs = collective.lazysizes
After updating the configuration you need to run ‘’bin/buildout’’, which will take care of updating your system.
Go to the ‘Site Setup’ page in a Plone site and click on the ‘Add-ons’ link.
Check the box next to collective.lazysizes and click the ‘Activate’ button.
How does it work
This package adds a transform to the transform chain to integrate lazysizes into Plone.
The transform looks for all the <img> and <iframe> elements inside the content and does the following:
appends a lazyload class
transforms the src attribute into a data-src attribute
if the element is an <img>, uses an spinner as src attribute (this is done to maintain valid HTML code)
The transform is only applied to anonymous users.
As long as we have tested, lazysizes seems not to interfere with image indexing made by crawlers like Googlebot.
Todo
implement support for responsive images with srcset and automatic sizes attribute
Changelog
1.5.0a1 (2016-04-07)
Use data URI scheme for image placeholder to save one additional request (closes #8). [hvelarde]
Brazilian Portuguese and Spanish translations were added. [hvelarde]
Deal better with <img> tags with no src attribute; log an error message with the request URL (closes #11). [hvelarde]
Package is now compatible with Plone 5. [hvelarde]
Remove dependency on Products.CMFQuickInstallerTool. [hvelarde]
Update lazysizes and respimg polyfill extension to v1.5.0. [hvelarde]
1.4.0a1 (2016-02-23)
Add option to list class identifiers that will not be processed for lazy loading. <img> and <iframe> elements with that class directly applied to them, or to a parent element, will be skiped (closes #5). [rodfersou, hvelarde]
Update lazysizes and respimg polyfill extension to v1.4.0. [hvelarde]
Use a blank image instead of a spinner as placeholder. [hvelarde]
Logging now uses debug level instead of info. [hvelarde]
1.0a1 (2016-01-05)
Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for collective.lazysizes-1.5.0a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb985eca286b587abcf4ef7b7e849458e7dc110bc800e51573a1d4f58f5b3d28 |
|
MD5 | 227cfcf9d161db7cd832f053e6b1c6f0 |
|
BLAKE2b-256 | 69ca2c2024fa8e7755d6d0a18d992b5d102a5c830ddd4507059f108b5d5876ba |