-
-
Notifications
You must be signed in to change notification settings - Fork 96
Open
tempoxyz/docs
#25Description
Bug Description
When using the :::changelog directive on a non-root page (e.g., /changelog), clicking on version links in the Versions outline redirects to /#v1.0.0-rc.5 instead of /changelog#v1.0.0-rc.5.
Steps to Reproduce
- Create a changelog page at
/changelogwith the:::changelogdirective - Click on any version in the "Versions" outline on the right side
- Observe that it navigates to
/#versioninstead of/changelog#version
Expected Behavior
Version links should navigate to /changelog#v1.0.0-rc.5 (keeping the current page path).
Actual Behavior
Version links navigate to /#v1.0.0-rc.5 (losing the page path, just hash on root).
Root Cause
In src/react/internal/Changelog.client.tsx, line ~203:
<a
href={`#${release.version}`}This relative hash link does not preserve the current pathname on some browsers/routers.
Suggested Fix
Use the current pathname when building the href:
const pathname = useLocation().pathname
// ...
<a
href={`${pathname}#${release.version}`}Or use React Router's Link component with to={{ hash: release.version }}.
Environment
- vocs version:
https://pkg.pr.new/wevm/vocs@d503413 - Page: https://docs.tempo.xyz/changelog
Metadata
Metadata
Assignees
Labels
No labels