-
Notifications
You must be signed in to change notification settings - Fork 295
[Workaround] Ensure info/index doc is first item in sidebar #51
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
Conversation
|
Size Change: -47.9 kB (-2%) Total Size: 2.31 MB
ℹ️ View Unchanged
|
|
Visit the preview URL for this PR (updated for commit 0ea621b): https://docusaurus-openapi-36b86--pr51-svs2w67w.web.app (expires Wed, 18 May 2022 15:09:47 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
|
Seeing the following when attempting to build locally: ...
[ERROR] Error: Failed to retrieve the git history for file "/Users/sserrata/projects/panw/docusaurus-openapi/demo/api/food/burgers/list-all-burgers.mdx" with unexpected output:
[ERROR] Error: Failed to retrieve the git history for file "/Users/sserrata/projects/panw/docusaurus-openapi/demo/api/food/yogurtstore/list-all-flavors.mdx" with unexpected output:
[ERROR] Error: Failed to retrieve the git history for file "/Users/sserrata/projects/panw/docusaurus-openapi/demo/api/food/yogurtstore/index.mdx" with unexpected output: Error seems to get thrown here: https://github.com/facebook/docusaurus/blob/2eeb0e46a2e037a885a30c653d73dd1a3e921c94/packages/docusaurus-utils/src/gitUtils.ts#L140 We can control using |
blindaa121
left a comment
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.

Description
Docusaurus
autogeneratedsidebars sorts sidebar doc items alphabetically by default which can push the OpenAPI "Introduction" doc out of first position. This change automatically addssidebar_position: 0to frontmatter to help ensureindex.mdis the first doc item for a given API.Motivation and Context
Docusaurus automatically makes
index.mdthe category link when applyingautogeneratedto the doc parent/root directory, e.g.{type: "autogenerated", dirName: "."}. It also hides theindex.mddoc from the sidebar. Unfortunately this behavior does not carry over when applyingautogeneratedto a non-parent path, e.g.{type: "autogenerated", dirName: "petstore"}.See this issue and this one for more details.
How Has This Been Tested?
Screenshots (if appropriate)
Types of changes
Checklist