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.
According to the docs (https://docusaurus.io/docs/sidebar/autogenerated#doc-item-metadata), doc items should support the
customProps
argument, using thesidebar_custom_props
frontmatter item. Added support for it to the default generatorPre-flight checklist
Motivation
For a certain website feature, I needed the ability to add customProps to all sidebar items on the website, so I can tag pages more consistently in the navigation. I noticed that the feature itself was documented as supported, but did not work, and then identified the exact piece of code that was missing.
Test Plan
The testing plan was simple - Take an existing passing test for a simple sidebar, copy it, add test custom props to different items of it, and then add those same props to a copy of the resulting snapshot, and check that the two align.
Test links
https://github.com/OdedItkinOW/docusaurus/blob/patch-1/packages/docusaurus-plugin-content-docs/src/sidebars/__tests__/generator.test.ts
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs