Skip to content

Commit

Permalink
Add lazy loading to all responsive images
Browse files Browse the repository at this point in the history
  • Loading branch information
LkeMitchll committed Jan 17, 2022
1 parent e673a5f commit 7bab7f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shortcodes/responsiveImage.js
Expand Up @@ -31,6 +31,8 @@ module.exports = function responsiveImage(imageSrc, size, asObject = false) {
return {
src: fallback,
srcset: sources,
sizes: `${viewportWidths[size].sizes}`,
loading: "lazy",
alt: imageSrc.fields.description,
width: imgWidth,
height: imgHeight,
Expand Down

0 comments on commit 7bab7f1

Please sign in to comment.