-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Book: Broken anchor-links because of HTML base-tag #195
Comments
Looking into this some more it seems the I still don't understand why this was required but it looks like mdBook had some issues with this before and this change removed all |
Aj that is a problem. We inserted the We'll have to find a better way to do this because its already kind of a hack. |
Hm, I still don't quite get the problem. If I'm on a |
Im not sure whats happening but if you remove the |
Okay so I figured out what the issues is: When browsing However, these is an issue with netlify where it is currently impossible to add a slash to the url. (https://community.netlify.com/t/bug-in-non-trailing-slash-rewrite/452/38) For now, I will remove the
Then we also no longer need the silly mdbook workaround and we can speed up the generation of the book drastically. (Related to #190) |
Ok, that makes sense. It only happens on Well, the JavaScript is quite hacky but at least it works now, and hopefully, Netlify will fix this soon. |
All the anchor links in the book are broken because of the
base
tag that is inserted on every page.When a
base
tag is present the anchor link will be relative to the base address instead of the current page so, for example, clicking on a heading on this page redirects to the index page.I'm not sure why there even is a
base
tag in the first place but it seems to be added by this CI script according to the value from here.The easiest fix would be to remove the
base
tag. I don't think there is a reason for it. Other rust books also don't use one and since mdBook pages are all on the root level stuff like CSS will still be loaded from the correct path.The text was updated successfully, but these errors were encountered: