https://discuss.asciidoctor.org/include-and-imagesdir-in-different-folders-tp8154p8159.html
> Am I missing something, do you have a solution for that?
Including a file does not change the current directory. You have to think of includes as all the files being combined together and then the result being converted. So they are flat. (Only the include targets themselves are relative to the parent document).
So you would either need to
a) modify the imagesdir in different places in the document, or
b) use a shared image folder with topic folders that mirror the folders you are using for the documents.
I prefer (b). You structure might look like this:
index.adoc
topic-a/
doc.adoc
topic-b/
doc.adoc
images/
topic-a/
image-for-topic-a-doc.png
topic-b/
image-for-topic-b-doc.png
Then, in topic-a/doc.adoc, the image reference would be:
image::topic-a/image-for-topic-a-doc.png[]
At the top of the file, you could define an attribute like:
:topic: topic-a
then reference the image as:
image::{topic}/image-for-topic-a-doc.png[]
or change imagesdir like:
:imagesdir: images/topic-a
then reference the image as:
image::image-for-topic-a-doc.png[]
There are lots of possible solutions. But they all come down to storing the images under a separate hierarchy.
Best Regards,
-Dan