Skip to content
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

Use the Docusaurus-native sidebar configuration schema #136

Open
5 tasks
ptgott opened this issue Feb 26, 2025 · 1 comment
Open
5 tasks

Use the Docusaurus-native sidebar configuration schema #136

ptgott opened this issue Feb 26, 2025 · 1 comment

Comments

@ptgott
Copy link
Contributor

ptgott commented Feb 26, 2025

Currently, the prepare-files.mts script needs to convert the docs site configurations at config.json in each version of the docs to a format that Docusaurus can ingest. Let's replace the config.json format with this format so we don't need to perform the conversion.

Warning: the docspaths workflow in shared-workflows relies on the current structure of each docs version's config.json file. Other workflows might as well. Make sure nothing breaks when moving to the Docusaurus-native schema.

Steps:

  • Edit scripts/prepare-files.mts to accept the Docusaurus config format as an input in addition to the legacy docs/config.json format
  • Update the docpaths workflow to accept the Docusaurus config format in addition to the legacy format
  • Migrate all docs/config.json files to the Docusaurus config format
  • Edit scripts/prepare-files.mts to remove the configuration transformation and only move the config file to the new location.
  • Update the docpaths workflow to only accept the Docusaurus config format
@ptgott
Copy link
Contributor Author

ptgott commented Feb 27, 2025

Getting the new docs engine to accept both the old and new config structures:

@docusaurus/plugin-content-docs doesn't seem to export functions to validate instances of the SidebarsConfig type. However, there is code to validate the legacy config structure.

We can edit docusaurusifyNavigation (GitHub) to:

  • Take an arbitrary object as an argument
  • Attempt to validate the object as a legacy config
  • If it's a legacy config, process it as normal
  • If it's not a legacy config, leave it unchanged, with the assumption that Docusaurus will catch any failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant