-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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(v2): allow relative sidebar path resolution in docs:version command #4861
Conversation
✔️ [V2] 🔨 Explore the source changes: 76a671f 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60b7a74cf8c4cf0008cce837 😎 Browse the preview: https://deploy-preview-4861--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4861--docusaurus-2.netlify.app/ |
✔️ [V1] 🔨 Explore the source changes: 76a671f 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-1/deploys/60b7a74cc61dc600079a32ba 😎 Browse the preview: https://deploy-preview-4861--docusaurus-1.netlify.app |
Size Change: +1.25 kB (0%) Total Size: 621 kB
ℹ️ View Unchanged
|
LGTM thanks 👍 Just extracted Also dogfooding on our site: docs use relative path, community use absolute path, so we'll notice more easily potential regresssions |
I too facing this issue while running
Under which version of docusaurus this issue is solved ? |
@sriramgroot will be rerleased soon but you can try the |
@slorber whether this needs to be executed in terminal were the |
Version generation worked with this config changes |
yes because require.resolve converts to absolute path Or you can keep it as it used to be and use a canary: https://www.npmjs.com/package/@docusaurus/core |
Motivation
Resolves #4844
Because we do not seem to have a strict requirement that the sidebar file path be absolute, currently users who use relative path in the
sidebarPath
field will get an error when creating new docs version.Although after merging of #4775
docs:versions
command will no longer fails, and just silently create empty sidebar file. However, this is not what the user expects - copy of current sidebar file in new docs folder. So I think instead of forcing users to specify only absolute path to the sidebar file, we can automatically resolve relative path to it when cutting new docs version.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Not sure if tests are needed here?
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)