-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Override alias template to preserve anchor fragment #24394
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
Conversation
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
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 think it would be best if this was fixed upstream, but while that's not done I'm fine with that workaround.
Co-authored-by: silverwind <[email protected]>
I can take a look and propose it upstream as well. 👍 |
This PR fixes an annoyance where docs aliases aren't preserving their anchor fragments.
The refactor included aliases to keep old links from dying, but currently they redirect without their anchor, which was used often to jump to sections.
This overrides the alias template with an alternative that preserves the anchor fragment.
To note, this is just a copy of the embedded template, but defaults to a JS redirect that preserves the anchor, and uses the meta tag as a fallback for noscript users.
I've also preserved query params, but I can remove that if we don't think it's necessary.