https://github.com/raruto/cockpit-native-lazy-loading
Native lazy loading addon for Cockpit CMS
https://github.com/raruto/cockpit-native-lazy-loading
addon cockpit lazy-loading
Last synced: 4 months ago
JSON representation
Native lazy loading addon for Cockpit CMS
- Host: GitHub
- URL: https://github.com/raruto/cockpit-native-lazy-loading
- Owner: Raruto
- License: mit
- Created: 2021-01-29T00:07:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-29T10:52:44.000Z (over 4 years ago)
- Last Synced: 2025-01-24T08:11:37.110Z (5 months ago)
- Topics: addon, cockpit, lazy-loading
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cockpit-native-lazy-loading
Native lazy loading addon for [Cockpit CMS](http://getcockpit.com/)
## Features
Automatically add [`img[loading="lazy"]`](https://web.dev/browser-level-image-lazy-loading/) 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](https://caniuse.com/#feat=loading-lazy-attr) that do not support the loading attribute simply ignore it without side-effects.
## Installation
### Manual
Download [latest release](https://github.com/Raruto/cockpit-native-lazy-loading/releases/latest) and extract to `COCKPIT_PATH/addons/NativeLazyLoading` directory
### Git
```sh
git clone https://github.com/Raruto/cockpit-native-lazy-loading.git ./addons/NativeLazyLoading
```### Cockpit CLI
```sh
php ./cp install/addon --name NativeLazyLoading --url https://github.com/Raruto/cockpit-native-lazy-loading.git
```### Composer
1. Make sure path to cockpit addons is defined in your projects' _composer.json_ file:
```json
{
"name": "MY_PROJECT",
"extra": {
"installer-paths": {
"cockpit/addons/{$name}": ["type:cockpit-module"]
}
}
}
```2. In your project root run:
```sh
composer require raruto/cockpit-native-lazy-loading
```---
**Compatibile with:** [](https://github.com/agentejo/cockpit)