-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix Sidebar issue. #2090
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
Fix Sidebar issue. #2090
Conversation
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 fixes the sidebar routing issue in the Wallet API documentation by adjusting how URL paths are transformed in the transformItems function.
- Fix root path handling by converting "/index" endings and "/" to the correct "/wallet/" routes
- Update code style by standardizing quotes and formatting in the file
| if (!newItem.href.startsWith("/")) { | ||
| newItem.href = `/${newItem.href}`; | ||
| } | ||
| if (newItem.href.endsWith("/index")) { | ||
| newItem.href = newItem.href.slice(0, -5); | ||
| } | ||
| if (!newItem.href.startsWith("/")) { | ||
| newItem.href = `/${newItem.href}`; | ||
| if (newItem.href === "/") { | ||
| newItem.href = "/wallet/"; | ||
| } else { | ||
| newItem.href = `/wallet${newItem.href}`; | ||
| } |
Copilot
AI
Jun 17, 2025
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.
Consider consolidating the URL normalization logic in the transformItems function. For clarity, ensure that the decision to always prefix with '/wallet' aligns with handling both absolute and relative paths uniformly.
| if (!newItem.href.startsWith("/")) { | |
| newItem.href = `/${newItem.href}`; | |
| } | |
| if (newItem.href.endsWith("/index")) { | |
| newItem.href = newItem.href.slice(0, -5); | |
| } | |
| if (!newItem.href.startsWith("/")) { | |
| newItem.href = `/${newItem.href}`; | |
| if (newItem.href === "/") { | |
| newItem.href = "/wallet/"; | |
| } else { | |
| newItem.href = `/wallet${newItem.href}`; | |
| } | |
| newItem.href = normalizeHref(newItem.href); |
alexandratran
left a comment
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.
LGTM
Description
Fix Wallet API Documentation Introduction Link Routing
Problem
The "Introduction" link in the Wallet API documentation sidebar was incorrectly routing to
/wallet/index/instead of/wallet/, causing a "Page not found" error. This was due to the order of operations in thetransformItemsfunction where path transformations were being applied in an incorrect sequence.Changes
/wallet/instead of/wallet/index/Fixes
Fixes #1854
Preview
Checklist
Complete this checklist before merging your PR: