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
Stay on page when switching versions broken for default version #4012
Comments
Thanks for reporting. If this is related to redirects, this sounds like something to be reported on the Edit: Ah, or do you mean that the URL is not preserved when switching versions? I'm confused as you referenced |
Go to https://hatch.pypa.io/latest/config/metadata/ then try the 1.1 dropdown and watch the page you're on remain, then go back and try again with 1.2 (what latest is) and watch the page change to home |
Thanks for the step-by-step guide, that made reproduction simple. That's odd. It seems that it only happens when you change from |
I know where this is coming from. Fixed in 7512441. You've set
Commenting out this line fixes the problem. However, we can't just take out the filter, as then all navigation would be intercepted, which will break instant loading. Inter-version navigation and instant loading need to be separate pipelines as they behave entirely differently. Thus, I moved the Inter-version navigation and instant loading are both in need of refactoring. I will tackle all this when I will next work on instant previews, which use parts of the same logic, as this is a great opportunity for refactoring this. |
To add: my initial confusion came from the fact that there is a deployment for |
Thanks for the fix!!! Not sure how long but https://github.com/jimporter/mike says:
I do that because I like retaining |
Released as part of 8.3.5. |
Thank you!!! |
I think this has introduced a weird bug in my case: latest alias: https://docs.mastercomfig.com/latest/ it gets into a redirect loop going to the latest URL for some reason, appending latest over and over again |
Hmm, I'm not sure I'm seeing the behavior you're describing. Could you elaborate? |
Could you try the latest |
Has the same faulty behavior. Note that it does work for |
How did you configure |
@mastercoms – First of all – you urgently need to redeploy your documentation, either with the latest version of Insiders, or with 14.8.0, because currently, navigation (all links) is not working outside of the version selector. This is a regression introduced in the commit linked here and fixed in #4028. I've checked your docs and I'm not redirected (see video), regardless of whether I append the slash or not. Could you try the same in an incognito window to avoid the browser cache? Ohne.Titel.mp4Furthermore, I tried to create re reproducible example myself, but failed – everything worked when I follow the guidelines laid out in our documentation, see: https://squidfunk.github.io/versioning-test/ |
I did deploy that new version, about 8 minutes after you fixed it. That link problem was happening on my PC, and is no longer happening after that deploy, so the new version did deploy. Not sure why it still happens on your end, maybe an out of date edge cache, will look into fixing. I'll make a new issue after looking into isolating this bug. It's strange, because a user reported this redirect bug to me and multiple others were able to confirm it happening. |
Okay, great. The issue is not happening anymore, might have been a caching issue. Regarding the bug, you can check with your users if it also happens for them on https://squidfunk.github.io/versioning-test/ |
After further investigation, this is entirely a Mike issue, will look into it a bit more and report there. Still not sure why it only recently started happening, but sorry for wasting your time! |
This broke again, now only when anchors are selected e.g. go to https://hatch.pypa.io/latest/intro/#setup then select any version from the dropdown |
@ofek can you try to narrow it down? Happy to look into it with something I can deploy and debug. |
https://github.com/pypa/hatch/blob/hatchling-v1.8.1/mkdocs.yml was built with |
Actually, I've just tested and it seems that version switching has never worked with anchors 😅 Could you please create a new issue? It's related, but not the same error as this one. |
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
For https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/, if I have versions
1.0
,1.1
, and1.2
, withlatest
pointing to1.2
:/latest/page/
-> dropdown1.0
: ok/1.0/page/
/latest/page/
-> dropdown1.1
: ok/1.1/page/
/latest/page/
-> dropdown1.2
: redirect/1.2/
Expected behaviour
Switching to the permanent link of the current default page should work
Actual behaviour
Redirects to root
Steps to reproduce
Example page https://hatch.pypa.io/latest/config/metadata/
Package versions
3.10.5
1.3.0
8.3.4
Configuration
https://github.com/pypa/hatch/blob/master/mkdocs.yml
System information
The text was updated successfully, but these errors were encountered: