Socket
Socket
Sign inDemoInstall

gatsby-remark-lazy-load

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gatsby-remark-lazy-load

This plugin lazy loads image processed by gatsby-remark-images plugin


Version published
Weekly downloads
431
decreased by-20.92%
Maintainers
1
Install size
27.9 kB
Created
Weekly downloads
 

Readme

Source

gatsby-remark-lazy-load

Lazyloads images processed by gatsby-remark-images with using lazysizes

The plugin makes lazyload possible by:

  • Move src and srcset to data-src and data-srcset respectively.
  • Add class lazyload to img tag.

lazysizes has to be installed to make this plugin work.

Install

npm install --save gatsby-remark-lazy-load

npm install --save lazysizes

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
        {
          resolve: `gatsby-remark-images`,
        },
        `gatsby-remark-lazy-load`,
      ]
    }
  }
]
// In your gatsby-browser.js
import 'lazysizes'

Contribution

This is a minimum plugin. Please make an issue when you need more functionalities or code doesn't work!

Keywords

FAQs

Last updated on 21 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc