Copy image to final output folder? #1945
-
I have this input structure:
In my markdown files, images are referenced as:
But when eleventy generates the output...
...It adds one level of depth to the relative path, breaking all of them. I really want to keep a simple structure in the input folder and avoid having to create a folder for each post and their images. My ideal output would either copy all used images to the post folder, or modify the output reference to match the new scheme. Any tips? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think I'm a bit confused here. If you have a simple repo w/ test case I can take a closer look. Or if not I can probably create it from scratch. |
Beta Was this translation helpful? Give feedback.
I think I'm a bit confused here.
In your input folder you have a template,
./input/post2.md
, which references absolute images like![](/images/img2.jpg)
. And your output folder writes the file as/post2/index.html
and your images are deployed as/images/img2.jpg
.I wouldn't expect any images to break once deployed (assuming you just deploy the /site output folder) since they're absolute URLs. If they were relative URLs, I could see that it could be a potential issue though.
If you have a simple repo w/ test case I can take a closer look. Or if not I can probably create it from scratch.