GithubHelp home page GithubHelp logo

For low quality placeholders, an option to write a new file instead of inlining base64 encoded string about eleventy-plugin-lazyimages HOT 4 CLOSED

liamfiddler avatar liamfiddler commented on May 22, 2024
For low quality placeholders, an option to write a new file instead of inlining base64 encoded string

from eleventy-plugin-lazyimages.

Comments (4)

MaybeThisIsRu avatar MaybeThisIsRu commented on May 22, 2024 1

Hi @liamfiddler :)

Unfortunately, even though the syntax matches with what LazySizes have specified in their documentation, it just doesn't appear to be working the way they claim it should. That said, since this is the case, I am altogether dropping the LQIP pattern from my site, and sticking to just native lazy loading with no polyfilling. The extra JavaScript is not worth it in my scenario anymore.

Since this deviates heavily from the goal of this plugin, I believe it makes sense for me to just create a simple plugin instead. Doing only one thing - adding a loading="lazy" attribute to all img tags, unless one exists already, and adding width and height attributes. It will be a heavily stripped down version of your plugin.

from eleventy-plugin-lazyimages.

liamfiddler avatar liamfiddler commented on May 22, 2024 1

No problem. I'll close this issue and the PR.

from eleventy-plugin-lazyimages.

MaybeThisIsRu avatar MaybeThisIsRu commented on May 22, 2024

I have an open PR with an (almost) working solution: #21

There's one thing I still can't figure out. I want the browser to load all images specified in the src attributes, but lazyload higher res versions specified in data-src or data-srcset. This doesn't appear to work either with lazysizes, or with native lazy loading.

Lazysizes says this is possible. But it doesn't appear to be the case, even if I set preferNativeLazyLoad to false and ensure only LazySizes is used.

from eleventy-plugin-lazyimages.

liamfiddler avatar liamfiddler commented on May 22, 2024

👋 Hi @hirusi !

That isn't a use case I considered but it sounds useful. I'll look at the PR over the next few days. Thanks!

I'm not sure about the second problem - it's not something I've tested before.

Setting preferNativeLazyLoad is the correct approach to ensure Lazysizes is always used.

If that didn't work I'd recommend you look at the markup in your built site (particularly the parts generated by this plugin) and confirm it matches the markup expected by lazysizes.

from eleventy-plugin-lazyimages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.