Comments (3)
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.
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.
- 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 callingreplaceImages()
to generate<link rel="preload" ... />
tags and inserted into the HTML document (content
). - Since the plugin is made for different file formats for each image, like
avif
,webp
, andjpg
, which one can be used in the<link rel="preload" ... />
tag? How can we figure out themedia
attribute? Is it possible from thesizes
attribute? - 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.
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)
- Generated AVIF images are not displayed in Chrome Canary
- "no such file or directory" error when building HOT 7
- `sizes` attribute from `<img>` is not replicated on `<source>`
- `TemplateWriterWriteError` when trying to use the plugin HOT 16
- Does not work for output directories not named "_site" HOT 5
- Applying Sharp placeholder HOT 2
- AVIF size? HOT 5
- Plugin messes with markup when `<body>` attribute names have special characters HOT 12
- Make moving classes to picture tag optional HOT 4
- caching generated images HOT 2
- Can't not have an alt text HOT 2
- Remote images not being optimised HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eleventy-plugin-img2picture.