-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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: wrong url in next/prev button in some cases #1488
Conversation
Deploy preview for docusaurus-2 ready! Built with commit a4a64a8 |
Deploy preview for docusaurus-preview ready! Built with commit a4a64a8 |
@hongarc yes u can remove that line. |
Sorry, that is my fault, if I remove that line, |
relativeHref
relativeHref
in next/prev button
And I have one way is: --- .replace('\\', '/')
--- .replace(/^\.\.\//, '')
+++ .replace(new RegExp(`^\\.\\.\\${path.sep}`), '') It is shorter. Are you want to use it? |
Nah, keep it as it is. Shorter doesn't mean it's more declarative. |
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
Good trick of appending html to make sure faq
and faq/general
relativeHref is correct
Previously it will be general
but after this PR it become ../faq/general.html
relativeHref
in next/prev button
Motivation
Resolved #1344
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
node_modules/docusaurus
yarn start
http://localhost:3000/faq
http://localhost:3000/faq/general
http://localhost:3000/faq
(it goes tohttp://localhost:3000/
without this commit)You can see the preview in https://hongarc.github.io/redux/faq