Skip to content
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

[docs] make search redirect relatively to current version (fixes #25860) #28097

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

maxpumperla
Copy link
Contributor

Signed-off-by: Max Pumperla max.pumperla@googlemail.com

Why are these changes needed?

fixes #25860

Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
@maxpumperla maxpumperla requested a review from a team as a code owner August 25, 2022 11:54

const pageUrl = window.location.href
const res = pageUrl.split("/");
const version = (res.length <= 3) ? "latest" : res[4];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about "master"?

Copy link
Contributor Author

@maxpumperla maxpumperla Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardliaw this catches edge cases for the docs URL like localhost:8000 and defaults to latest for search in those cases, and otherwise extracts the proper version such as releases-1.13.0 or master.

@richardliaw richardliaw merged commit 50cb513 into master Aug 25, 2022
@richardliaw richardliaw deleted the mp_relative_search branch August 25, 2022 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docs] Search redirects to latest
2 participants