feat(content-docs): support custom versioned docs path#12189
Open
waqarilyas wants to merge 1 commit into
Open
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8061.
This adds a
versionedDocsPathoption to@docusaurus/plugin-content-docs, allowing projects to keep generated versioned docs and sidebars outside the site directory.By default, nothing changes: versioned docs are still written to the site directory under
versioned_docsandversioned_sidebars.Motivation
Some projects keep their docs content outside the Docusaurus site root, but
docusaurus docs:versionalways writes generated version folders back into the site directory. This makes monorepo and multi-docs setups harder to organize.With
versionedDocsPath, the docs plugin can writeversioned_docsandversioned_sidebarsunder a configured directory instead.Changes
versionedDocsPathto the docs plugin options and TypeScript types.docs:versionCLI flow to write generated docs/sidebars to that path.Test plan
pnpm install --frozen-lockfilepnpm test packages/docusaurus-plugin-content-docspnpm test packages/docusaurus-plugin-content-docs/src/__tests__/versionedDocsPath.test.ts packages/docusaurus-plugin-content-docs/src/versions/__tests__/files.test.tspnpm eslint --cache --report-unused-disable-directives packages/docusaurus-plugin-content-docs/src/cli.ts packages/docusaurus-plugin-content-docs/src/options.ts packages/docusaurus-plugin-content-docs/src/plugin-content-docs.d.ts packages/docusaurus-plugin-content-docs/src/versions/files.ts packages/docusaurus-plugin-content-docs/src/__tests__/versionedDocsPath.test.ts packages/docusaurus-plugin-content-docs/src/versions/__tests__/files.test.tspnpm oxfmt packages/docusaurus-plugin-content-docs/src/cli.ts packages/docusaurus-plugin-content-docs/src/options.ts packages/docusaurus-plugin-content-docs/src/plugin-content-docs.d.ts packages/docusaurus-plugin-content-docs/src/versions/files.ts packages/docusaurus-plugin-content-docs/src/__tests__/versionedDocsPath.test.ts packages/docusaurus-plugin-content-docs/src/versions/__tests__/files.test.ts website/docs/api/plugins/plugin-content-docs.mdx website/docs/guides/docs/versioning.mdx