New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local images #6
Comments
Hi @nothingrandom 👋 Images should be working - both locally and when pulled from a third-party server. To demonstrate this I've added some local images to the "basic" example. Take a look at this commit to see what's changed. Let me know if this example helps, or if you have a public repo I could look at 😃 |
Hey! I think one of the big differences might be the project structure. My structure is like this;
So .eleventy.js is in the root, files and images are both in Should I do something to fix this my end, or does this want to be a plugin change, with some more support for folder structure? |
OK, I think I understand now. The Something like this might work for you (untested): // .eleventy.js
module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(lazyImagesPlugin, {
transformImgPath: (imgPath) => {
if (imgPath.startsWith('/') && !imgPath.startsWith('//')) {
return `./src${imgPath}`;
}
return imgPath;
},
}); |
Yep, that worked perfect. Thank you very much! |
Can't get this to work with images as part of the build process. I think there's some path issues.
See that none of your examples allow for this - is that intentional?
The text was updated successfully, but these errors were encountered: