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.
Mostly Harmless
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.
Todo
implement support for responsive images with srcset and automatic sizes attribute
replace spinner with low resolution image scale (if not to expensive to calculate)
allow blacklisting images (lazing loading feature could be duplicated on some carousels)
Changelog
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
Built Distribution
Hashes for collective.lazysizes-1.4.0a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5faaca17e32bd91dcebe069ac69b8190ec7e49d75c70d290d9cd31f0d85359ba |
|
MD5 | 73901a227f5ce63ee8d2b55eb1ad9699 |
|
BLAKE2b-256 | 40c8a8cb7a11c7431095d3347fb85ebe099487bc496b04a1c9a5ac0b8a847344 |
Hashes for collective.lazysizes-1.4.0a1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ebaff3b632401da75b34675eada6cbaf709adb7d8d0f8a224f38ad7a9167598 |
|
MD5 | 8fd8f39ab4b12ba219b4c092f425e641 |
|
BLAKE2b-256 | e3dbf493578e8d99bda00ee06054eaf6a8d5bd17c9a63a3c4ad833cac40bde97 |