Halo-Lab / eleventy-packages

Monorepo for all Eleventy plugins.
24 stars 1 forks source link

Handle `loading` attribute as part of `lazy` field in image shortcode plugin #6

Open Kapelianovych opened 2 years ago

Kapelianovych commented 2 years ago

There might be a way to decide whether we can use the native loading attribute or a library for lazy loading. The same goes for the decoding attribute.

Kapelianovych commented 2 years ago

Workaround till the issue will be fixed:

this.image('url', { loading: 'eager', decoding: 'sync' })

You can rewrite loading and decoding attributes of the image by passing them explicitly to image options.