Hi, thank you for this plugin it’s truly awesome!
The issue is with relative src attributes for images. If I have this:
<!-- File src/posts/my-post.html -->
<img src="image.png">
With this in 11ty config:
dir: { input: 'src', output: '_site' },
And this in the plugin config:
folders: { source: 'src', output: '_site' },
The files are correctly generated (in _site/posts) but in the resulting HTML, I get references to posts/image***, instead of either image*** or /posts/image***, so the image is not displayed.
I made it work with a dirty workaround, by making generateSrcSet always return an absolute path:
function generateSrcset(sizes, src, type) {
return sizes.map(s => `/${replaceExt(src, `.${s}.${type}`)} ${s}w`).join(', ');
// ^
}
It goes without saying that this is not a clean way to proceed 😅, but I had to do it to use the plugin…
Hi, thank you for this plugin it’s truly awesome!
The issue is with relative
srcattributes for images. If I have this:With this in 11ty config:
And this in the plugin config:
The files are correctly generated (in
_site/posts) but in the resulting HTML, I get references toposts/image***, instead of eitherimage***or/posts/image***, so the image is not displayed.I made it work with a dirty workaround, by making
generateSrcSetalways return an absolute path:It goes without saying that this is not a clean way to proceed 😅, but I had to do it to use the plugin…