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

mdbook build creates broken links in v0.1.9 #746

Closed
cauebs opened this issue Jul 28, 2018 · 5 comments
Closed

mdbook build creates broken links in v0.1.9 #746

cauebs opened this issue Jul 28, 2018 · 5 comments
Assignees
Labels
Regression Regression from a previous version

Comments

@cauebs
Copy link
Contributor

cauebs commented Jul 28, 2018

If you use mdbook serve, it will work fine. v0.1.8 also works fine.

@mattico
Copy link
Contributor

mattico commented Jul 28, 2018

Can you give an example of a book/link which does not work correctly? Things seem to work fine for me.

@cauebs
Copy link
Contributor Author

cauebs commented Jul 29, 2018

This one, for example: https://github.com/cauebs/rust-cli-talk/
Just build it with v0.1.9 and open it in the browser. All CSS and JS fails to load.
If you want, I can try to reproduce it in a minimal example.

@mattico mattico self-assigned this Jul 29, 2018
@mattico
Copy link
Contributor

mattico commented Jul 29, 2018

Yes, I see the issue now. For some reason the book uses ../ as its path_to_root, from the changes in #603.

@mattico mattico added the Regression Regression from a previous version label Aug 2, 2018
@mattico
Copy link
Contributor

mattico commented Aug 2, 2018

Okay, found the bug. index.html is generated from the first chapter, which in this case is in a subdirectory. The path_to_root is ../ to escape the subdirectory but index.html is rendered into the root. This function was not updated by #603:

https://github.com/rust-lang-nursery/mdBook/blob/b5fd170008085720815489e984bc9699fdb0423b/src/renderer/html_handlebars/hbs_renderer.rs#L102-L106

@mattico
Copy link
Contributor

mattico commented Aug 2, 2018

Hmm, I thought that #603 was included in 0.1.8, but it's actually first in 0.1.9. I thought that #603 was backwards-compatible modulo bugs, but after reading it again, it is not. Any link relative to the book root will break, and many existing books use these. Therefore, I'm going to yank 0.1.9 and 0.1.10 to follow semver. I'll release a 0.2.0 from master shortly after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Regression from a previous version
Projects
None yet
Development

No branches or pull requests

2 participants