-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Wrong paths in 404 page on mkdocs.org #1785
Comments
Is this perhaps a duplicate of #1598? Wether it is a duplicate or not, it is certainly related as that issue discusses many extra considerations when generating error pages and it links to additional considerations from earlier discussions. In any event, your example doe snot make the problem clear to me. Could you provide an example which contains all of the following information:
Please provide the URL as it appears in the HTML source. In other words, use a text editor to open the built error page (site/ |
@waylan All called and wrong generated URLs can be found above. Also the used code. |
@waylan it would be good if this could be mentioned in the official documentation. It can be quite confusing to run into and try identify what is going wrong. Either MkDocs should detect a root domain at build time (no need for JS), or if resolving the problem isn't viable, the workaround/gotcha (root domain for Updating the IIRC, not providing a |
This is a tricky one to debug because the dev server overrides the setting and makes it impossible to test locally. I haven't found the time to work out what was causing this issue so thanks for that. We should be catching that in config validation and presumably adding the trailing slash if it is missing. In fact, that would be the fix for this issue--to update the validation code.
Yes, we are ware of the many issues with |
`urlparse(config['site_url']).path` can be empty if `site_url` does not end in a slash. This ensures at least a slash is returned. Config validation will add the slash if it is missing. Fixes mkdocs#1785.
`urlparse(config['site_url']).path` can be empty if `site_url` does not end in a slash. This ensures at least a slash is returned. Config validation will add the slash if it is missing. Fixes #1785.
Good:
https://www.mkdocs.org/foo
Bad:
The problem are the paths because it points to the wrong target. Examples:
The template filter URL does not help here.
https://github.com/mkdocs/mkdocs/blob/master/mkdocs/themes/mkdocs/base.html#L20
Any ideas to prevent the problem on the mkdocs.org and also in the used theme? Thank you in advance!
The text was updated successfully, but these errors were encountered: