Giter Club home page Giter Club logo

Comments (3)

ItsEthanH avatar ItsEthanH commented on May 29, 2024 1

Hey @saneef!

Thanks for the pointers. Just wanted to drop a quick comment to say that I'll take a look at this over the weekend and try to submit something.

I'm using your wonderful plugin in a project of mine where this kinda functionality would be really helpful, both to myself and to people making use of the project. Just don't want you to close it down, when I fully intend on adding this very soon :)

from eleventy-plugin-img2picture.

saneef avatar saneef commented on May 29, 2024

Hey @ItsEthanH, thanks for bringing this idea.  

Please do try, and send a PR.

I haven't really delved into the idea. But, here are some thoughts that popped in my head after reading your notes.

  1. The generateImage() returns a string with generated <picture>...<picture> HTML. Maybe, we could return an object with { picture: "<picture>...", otherDataNeededForPrelodedTag: ""}. This can be used later in the calling replaceImages() to generate <link rel="preload" ... /> tags and inserted into the HTML document (content).
  2. Since the plugin is made for different file formats for each image, like avif, webp, and jpg, which one can be used in the <link rel="preload" ... /> tag? How can we figure out the media attribute? Is it possible from the sizes attribute?
  3. If we have figured out the key things, a minor enhancement: we can insert the <link rel="preload" ... /> tags at the end of <head> tag, by default. Additionally, we can allow users to use HTML comment like <!-- img2picture:preload-tags --> to pinpoint the location to insert the preload tags.

Cheers.

from eleventy-plugin-img2picture.

stale avatar stale commented on May 29, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from eleventy-plugin-img2picture.

Related Issues (13)

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.