rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
18.42k stars 1.65k forks source link

Summary.md parsing in a sub folder #2488

Open anantshri opened 6 days ago

anantshri commented 6 days ago

Problem

I create books where there are multiple levels of subfolders in picture. When the page of a subfolder is opened at that point the summary.md starts pointing to the URLs in wierd ways.

Steps

example localhost:3000/folder1/page1.html is open and assume a menu entry for folder2/page1.html is suppose to be present.

at localhost:3000 the link correctly points to folder2/page1.html however when i ope localhost:3000/folder1/page1.html now the link points to localhost:3000/folder1/folder2/page1.html

so effectively the summary.md in each folder assumes that folder as base and creates links as relative. which is wrong. summary.md links are relative to root nowhere else.

Possible Solution(s)

summary.md should link urls relative to root at max to site_url nothing else.

Notes

No response

Version

mdbook v0.4.42
ehuss commented 6 days ago

I'm guessing you maybe have an index.hbs theme file from an older version? If so, that will need to be updated to the latest version since the navigation has changed.