-
Notifications
You must be signed in to change notification settings - Fork 367
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(doc-core): support sub nav menu highlight #4364
Conversation
🦋 Changeset detectedLatest commit: 06312ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 246 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #4364 +/- ##
==========================================
- Coverage 57.59% 51.02% -6.58%
==========================================
Files 672 664 -8
Lines 17794 18170 +376
Branches 3876 3976 +100
==========================================
- Hits 10249 9271 -978
- Misses 6934 8175 +1241
- Partials 611 724 +113 ☔ View full report in Codecov by Sentry. |
Summary
🤖 Generated by Copilot at ba68953
This pull request adds a feature to the
doc-core
package that highlights the sub nav menu items in the documentation site based on the current pathname and the active match or link property. It also updates theNavMenuGroup
component to use a utility function and a regular expression to improve the active state detection. It includes a changeset file and a Chinese translation for the feature.Details
🤖 Generated by Copilot at ba68953
base
andpathname
props from theNav
component to theNavMenuGroup
component in.theme-default/components/Nav/index.tsx
(link)withoutBase
utility function from the shared utils module in.theme-default/components/Nav/NavMenuGroup.tsx
(link)pathname
andbase
properties to theNavMenuGroupItem
interface in.theme-default/components/Nav/NavMenuGroup.tsx
(link)renderLinkItem
function to use a regular expression to test the active match or link of the item against the pathname without the base path in.theme-default/components/Nav/NavMenuGroup.tsx
(link)Related Issue
Checklist
pnpm run change
.