All Projects → gildesmarais → jekyll-loading-lazy

gildesmarais / jekyll-loading-lazy

Licence: MIT license
🧙🏽‍♀️ Automatically adds loading="lazy" to <img> and <iframe> tags. Load images on your sites lazily without JavaScript.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to jekyll-loading-lazy

lazy-load-images.js
Progressive & lazy loading images.
Stars: ✭ 17 (-58.54%)
Mutual labels:  lazy, lazy-load, lazyload, lazy-loading, lazyloading, lazyload-images, lazy-load-img
rocket-lazy-load
Standalone LazyLoad plugin for WordPress (based on WP Rocket)
Stars: ✭ 25 (-39.02%)
Mutual labels:  lazy-load, lazyload, lazy-loading, lazyloading, lazyload-images
magento2-catalog-lazy-load
Improve the load time of your Magento 2 categories pages by loading your images on demand with our Lazy Load Extension
Stars: ✭ 56 (+36.59%)
Mutual labels:  lazyload, lazy-loading, lazyloading, lazyload-images
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+15987.8%)
Mutual labels:  lazyload, lazy-loading, iframes, lazyload-images
Jquery.lazy
A lightweight, fast, feature-rich, powerful and highly configurable delayed content, image and background lazy loading plugin for jQuery & Zepto.
Stars: ✭ 965 (+2253.66%)
Mutual labels:  lazy, lazyload, lazy-loading, pagespeed
guide-to-async-components
📖 Guide To JavaScript Async Components
Stars: ✭ 79 (+92.68%)
Mutual labels:  lazyload, loading, lazy-loading, lazyload-images
Responsively Lazy
Lazy load responsive images
Stars: ✭ 1,080 (+2534.15%)
Mutual labels:  lazy, lazyload, lazy-loading
Accessible Image Lazy Load
😴 gandul! accessible lazy loading images
Stars: ✭ 281 (+585.37%)
Mutual labels:  lazy, lazyload, lazy-loading
lazyImages
基于ES6的轻量级,高性能,简便的图片懒加载 🐈
Stars: ✭ 43 (+4.88%)
Mutual labels:  lazy, lazy-loading, lazyload-images
lazysimon
Minimal effort 350 byte JavaScript library to lazy load all <img> on your website
Stars: ✭ 18 (-56.1%)
Mutual labels:  lazyload, lazy-loading, lazyload-images
React Progressive Loader
Utility to load images and React components progressively, and get code splitting for free
Stars: ✭ 224 (+446.34%)
Mutual labels:  lazyload, lazy-loading
Ng Lazy Load
Lazy loading images with Angular.
Stars: ✭ 12 (-70.73%)
Mutual labels:  lazy, lazyload
Ng In Viewport
Allows us to check if an element is within the browsers visual viewport
Stars: ✭ 178 (+334.15%)
Mutual labels:  lazyload, lazy-loading
Zsh Lazyload
zsh plugin for lazy load commands and speed up start up time of zsh
Stars: ✭ 33 (-19.51%)
Mutual labels:  lazy, lazyload
Pimg
📷 Mini Image Lazy Loader for P(R)eact and Vue
Stars: ✭ 97 (+136.59%)
Mutual labels:  lazy, lazy-loading
loadeer
🦌 Tiny, performant, SEO-friendly lazy loading library
Stars: ✭ 30 (-26.83%)
Mutual labels:  lazyload, lazy-loading
raf-pool
requestAnimationFrame pool to avoid busyness on the thread
Stars: ✭ 16 (-60.98%)
Mutual labels:  lazyload, lazyload-images
v-img
📸Use webp and lazyload images
Stars: ✭ 48 (+17.07%)
Mutual labels:  img, lazyload-images
React Lazy
Universal lazy loader components using IntersectionObserver for React
Stars: ✭ 118 (+187.8%)
Mutual labels:  lazyload, lazy-loading
Defer.js
🥇 A super small, super efficient library that helps you lazy load everything like images, video, audio, iframe as well as stylesheets, and JavaScript.
Stars: ✭ 138 (+236.59%)
Mutual labels:  lazyload, iframe

jekyll-loading-lazy

This plugin adds loading="lazy" to all img and iframe tags on your Jekyll site. No configuration needed.
If a loading attribute is already present nothing is changed.

loading="lazy" causes images and iframes to load lazily without any JavaScript. Browser support is growing.
If a browser does not support the loading attribute, it will load the resource just like it would normally.

If you like it, star it or sponsor it. 💓

Installation

  1. Add the following to your site's Gemfile:

    gem 'jekyll-loading-lazy'
  2. add the following to your site's _config.yml:

    plugins:
      - jekyll-loading-lazy

    Note: if jekyll --version is less than 3.5 use:

    gems:
      - jekyll-loading-lazy
  3. In your terminal, execute:

    bundle
  4. (re)start your Jekyll server with:

    jekyll serve

Usage

Install the plugin as described above. That's basically all there is.

💡 Tip: Note that the github-pages gem runs in safe mode and only allows a defined set of plugins. To use this gem in GitHub Pages, you need to build your site locally or use a CI (e.g. Github Workflow) and deploy to your gh-pages branch. Click here for more information.

Prevent lazy loading

In case you want to prevent loading some images/iframes lazily, add loading="eager" to their tags. This might be useful to prevent flickering of images during navigation (e.g. the site's logo).

See the following examples to prevent lazy loading.

Markdown example
![an example](/image.jpg){:loading='eager'}

This example assumes you're using Kramdown (Jekyll is using it by default).

HTML example
<img src="/image.jpg" alt="an example" loading="eager" />

Contributing

  1. Fork this repository
  2. Create your branch (git checkout -b feat/my-new-feature)
  3. Commit your changes (git commit -m 'Add cool feature')
  4. Push to the branch (git push origin feat/my-new-feature)
  5. Create a new Pull Request

Testing

rake

Credits

Thanks to @keithmifsud's jekyll-target-blank whereon this Jekyll plugin largely bases.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].