You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Add width/height attributes only #212
The advantage of the markdown-it plugin is that it will get the image dimensions once (I guess) even if the content with this image is shown in 5 HTML pages.
A transform based on HTML will probably get the image dimensions 5 times instead of 1, but there could be a cache of image dimensions based on the image file path.
What if there is a crop of the image in some of the HTML pages, based on responsive needs (I'm not sure eleventy-img allows that 🤔), so the resulting images have different dimensions in the different HTML pages? The markdown-it plugin doesn't seem to be the right solution here.
Just to be clear and answer your question @nhoizey (very late) the plugin has an in-memory cache that de-dupes requests so it shouldn’t have duplication for the same input/output in the way you suggest!
A new special formats option "passthrough" will now copy the file to output without sharp processing. This is different from "auto" which just reuses the same input format as output (but still does sharp processing). You can use alongside other formats too, if you want (though you probably wouldn’t want to). Tested that "passthrough" was about 20× faster than formats: ["auto"] on a local benchmark.
Activity
zachleat commentedon Feb 12, 2024
Also a shout out to this plugin linked up in the replies by @nhoizey https://github.com/boyum/markdown-it-image-size
simevidas commentedon Feb 12, 2024
Looks like
eleventyImageTransformPluginrequires Eleventy 3 which is still in alpha. I’ll test this code once version 3 is in beta.nhoizey commentedon Feb 12, 2024
Thinking out loud…
The advantage of the
markdown-itplugin is that it will get the image dimensions once (I guess) even if the content with this image is shown in 5 HTML pages.A transform based on HTML will probably get the image dimensions 5 times instead of 1, but there could be a cache of image dimensions based on the image file path.
What if there is a crop of the image in some of the HTML pages, based on responsive needs (I'm not sure
eleventy-imgallows that 🤔), so the resulting images have different dimensions in the different HTML pages? Themarkdown-itplugin doesn't seem to be the right solution here.zachleat commentedon Dec 13, 2024
Related to #133, should probably be implemented together!
zachleat commentedon Jul 24, 2026
Just dropping in here to list a few other features that have dropped, marginally related here:
Also worth mentioning the HTML Relative Passthrough File Copy feature: https://www.11ty.dev/docs/copy/#copy-a-file-alongside-a-template (it doesn’t add attributes but does perform the copy).
I would also shout out the
svgShortCircuitfeature which acts on the size difference of input versus output: https://www.11ty.dev/docs/plugins/image/#skip-raster-formats-for-svgzachleat commentedon Jul 24, 2026
Just to be clear and answer your question @nhoizey (very late) the plugin has an in-memory cache that de-dupes requests so it shouldn’t have duplication for the same input/output in the way you suggest!
zachleat commentedon Jul 25, 2026
A new special
formatsoption"passthrough"will now copy the file to output without sharp processing. This is different from"auto"which just reuses the same input format as output (but still does sharp processing). You can use alongside other formats too, if you want (though you probably wouldn’t want to). Tested that"passthrough"was about 20× faster thanformats: ["auto"]on a local benchmark.Global use
One-off use
Works with
eleventy:formatsin the transform plugin too:zachleat commentedon Jul 25, 2026
Shipping with v7.0.0-alpha.5
Fixes 11ty#212. Adds `passthrough` special format that skips sharp pr…
Update dependency @11ty/eleventy-img to v7 (#515)