Skip to content
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

Images with relative path not displayed on index.html #2380

Closed
J3rome opened this issue May 15, 2024 · 1 comment
Closed

Images with relative path not displayed on index.html #2380

J3rome opened this issue May 15, 2024 · 1 comment
Labels
C-bug Category: A bug, incorrect or unintended behavior

Comments

@J3rome
Copy link

J3rome commented May 15, 2024

Problem

Given the following folder structure :

- SUMMARY.md
- img/
  - image.png
- folderA
  - pageA.md
- folderB
  - pageB.md

The first entry in the SUMMARY.md point to [pageA](folderA/pageA.md)

I added image.png in pageA.md using a relative path like so :

![text](../img/image.png)

Once compiled, the images display properly when I navigate to /folderA/pageA.html (Which is where I am redirected when clicking on the section in the sidebar).

However, the images are not displayed on index.html which is pretty much a copy of /folderA/pageA.hml. The link to the image is still ../img/image.png. I would have expected the image link to be modified to img/image.png when the index.html was generated since it's one folder up in the hierarchy.

Am I doing something wrong ?

Steps

No response

Possible Solution(s)

No response

Notes

I also tested adding a link to another page using the following syntax

[link](../folderB/pageB.md)

The same behavior happen where the link on the index.html are not rewritten and are therefore broken.

Version

mdbook v0.4.37
@J3rome J3rome added the C-bug Category: A bug, incorrect or unintended behavior label May 15, 2024
@ehuss
Copy link
Contributor

ehuss commented May 16, 2024

Thanks for the report! I believe this is a duplicate of #2060, so closing in favor of that.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: A bug, incorrect or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants