-
Notifications
You must be signed in to change notification settings - Fork 28
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
Use relative paths for redirects #19
Conversation
@burkestar @zhimsel Would it be possible to get a review of these changes? |
I no longer have write access to the repo as I no longer work at DataRobot. |
See mkdocs/mkdocs-redirects#19 for a solution to fix the absolute redirects that cause redirects in Codacy Self-hosted versions to navigate back to the Latest version of the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into the same issue of mkdocs-redirects not being compatible with mike.
Right now I'm already using the solution from this pull request in production:
Here are the resulting changes to the redirect pages:
And here's the an example URL that correctly redirects to the target page:
https://docs.codacy.com/v2.0.387-deprecated/hc/en-us/articles/207278449/
@burkestar, how can we work to have these changes merged into the original project? |
Thanks @plannigan for the contribution here, and @prcr for the reminder. I'll get this released to PyPI today. Needs a changelog update and possibly a few other tweaks to get it ready. Sorry for the long delay! |
Released as 1.0.2 |
Fixes redirects with absolute links: mkdocs/mkdocs-redirects#19
Thanks for the quick reply @burkestar! 👍 I began doing a full rollout of the new version of the plugin to production but came across an issue in the specific scenario of having a redirect target |
* bump: Update mkdocs-redirects to 1.0.2 Fixes redirects with absolute links: mkdocs/mkdocs-redirects#19 * bump: Update mkdocs-redirects to 1.0.3
Resolves the regression of `README.md` handling introduced by #19. * Add more test cases. * Removes `ext` variable that wasn't being used.
Changes the path assigned to
location.href
to be relative to old html page.The PR adds pytest test cases to verify the produced paths.
You can also see the output in action. These are the configured redirects.
Using relative paths:
Fixes #17 (Local file redirects)
Fixes jimporter/mike#35 (Site hosted in a sub-directory without depending on a static
site_url
from themkdocs
config)