raruto / cockpit-native-lazy-loading
Native lazy loading module for Cockpit CMS
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Type:cockpit-module
Requires
- php: >= 7.3
- composer/installers: ^1.10
Suggests
- aheinze/cockpit: Please install Cockpit before installing this addon
This package is auto-updated.
Last update: 2024-10-29 05:41:27 UTC
README
Native lazy loading addon for Cockpit CMS
Features
Automatically add img[loading="lazy"]
attribute to content images (tinymce and html-editor).
Natively supported by the most popular browsers (Chrome, Edge, Opera and Firefox) without the need to use a separate JavaScript library. Browsers that do not support the loading attribute simply ignore it without side-effects.
Installation
Manual
Download latest release and extract to COCKPIT_PATH/addons/NativeLazyLoading
directory
Git
git clone https://github.com/Raruto/cockpit-native-lazy-loading.git ./addons/NativeLazyLoading
Cockpit CLI
php ./cp install/addon --name NativeLazyLoading --url https://github.com/Raruto/cockpit-native-lazy-loading.git
Composer
-
Make sure path to cockpit addons is defined in your projects' composer.json file:
{ "name": "MY_PROJECT", "extra": { "installer-paths": { "cockpit/addons/{$name}": ["type:cockpit-module"] } } }
-
In your project root run:
composer require raruto/cockpit-native-lazy-loading