0.0.6 • Published 3 years ago

@garrettbland/lazy-load-images v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

lazy-load-images

11ty plugin that adds lazy loading attribute to images

Get Started

Install the package

npm install -D @garettbland/lazy-load-images

Then add the plugin to your .eleventy.js file

// .eleventy.js
module.exports = (eleventyConfig) => {
    eleventyConfig.addPlugin(require('@garettbland/lazy-load-images'))
}

Usage

No need to do anything else. The plugin will check every image and add the loading="lazy" attribute automatically.

How does it work

This plugin uses jsdom to analyze the rendered html pages and then adds the loading="lazy" atrribute to every <img/> element.

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago