-
Notifications
You must be signed in to change notification settings - Fork 23
feat: docs url on landing page navigates to the selected version #612
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
feat: docs url on landing page navigates to the selected version #612
Conversation
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.
Pull request overview
This PR enhances the landing page navigation by making documentation links version-aware, ensuring users are directed to their preferred documentation version instead of always defaulting to the latest version.
Changes:
- Added logic to construct documentation URLs based on the user's preferred version
- Updated all three documentation links (user, admin, developer) to use dynamic paths
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…n links to user documentation when on landing page
| return `/docs/${section}/`; | ||
| } | ||
|
|
||
| return `${preferredVersion.path}/${section}/`; |
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.
Is the preferredVersion.path guaranteed to not have a trailing slash? 🙈 Do you have some utility function at hand you can use for robust path joining, like our urlJoin in web, so that it will get harder to break paths?
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.
Is the preferredVersion.path guaranteed to not have a trailing slash?
Yes, because it also relies on joining further parts to build consistent URLs , the (preferred)version object is auto-generated and relies on that format.
Do you have some utility function at hand
Unfortunately, there is no docusaurus public api for that. I could add something similar for that use case, but It feels a little overengineered
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.
mainly wanted to make sure that you're sure 😁 enforcing it would have been the icing on the cake. not a requirement from me
No description provided.