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

relative links are not correctly working on 0.4.42 #2482

Closed
mimoo opened this issue Nov 14, 2024 · 6 comments
Closed

relative links are not correctly working on 0.4.42 #2482

mimoo opened this issue Nov 14, 2024 · 6 comments
Labels
C-bug Category: A bug, incorrect or unintended behavior

Comments

@mimoo
Copy link

mimoo commented Nov 14, 2024

Problem

we had to downgrade to [email protected] in order to have relative links work in the rendered html (when we use subfolders in chapters). Version 0.4.42 had this problem:

  • imagine you have ./foo/bar.md and ./foo2/bar2.md in the summary file
  • imagine that in the rendered page you go to is in /foo/bar/index.html
  • then mdbook usually convert the link in the menu to the other page as ../foo2/bar2/index.html
  • but it doesn't and render it as foo2/bar2/index.html (which obv doesn't work)
@mimoo mimoo added the C-bug Category: A bug, incorrect or unintended behavior label Nov 14, 2024
@ehuss
Copy link
Contributor

ehuss commented Nov 14, 2024

Sorry, I'm not quite able to follow the reproduction. With those two entries in SUMMARY.md, going to /foo/bar/index.html would be a 404. Can you show the exact contents of the SUMMARY.md file, and any other relevant source files?

@mimoo
Copy link
Author

mimoo commented Nov 14, 2024

an example would be:

# Summary

- [page1](./page1/index.md)
- [page2](./page2/index.md)

if you are on page 1, the link to page 2 is broken and will lead to page1/page2/index.html

I can probably produce more logs, but the problem comes from the mdbook binary. If we get the version 0.4.42 it doesn't work, but if we install it with cargo install [email protected] the links are properly rendered. I'm assuming the bug comes from a path helper dependency or something

@ehuss
Copy link
Contributor

ehuss commented Nov 14, 2024

Hm, I'm not able to reproduce that.

Do you maybe have a stale book directory that needs to be deleted? Do you have a custom theme or any other custom settings? Which browser/platform are you on?

@mimoo
Copy link
Author

mimoo commented Nov 15, 2024

This was happening to us in cloudflare pages BTW, we didn't try reproducing it locally as downgrading the version fixed the issue. Here are the logs so you can see the exact dependency version pulled when doing cargo install mdbook. Maybe you can try to reproduce locally with the git commit that is getting pulled in these logs :o

Or you can just give up if nobody else is seeing this issue. Maybe not worth investigating if nobody else complains about that.

@ehuss
Copy link
Contributor

ehuss commented Nov 15, 2024

It looks like you have a custom index.hbs. It will need to be updated to the latest version since some of the navigation has changed.

@mimoo
Copy link
Author

mimoo commented Nov 15, 2024

oh I see, thanks so much for taking a look!

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