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 more reasonable sidebar ordering logic #132

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Feb 14, 2025

Closes gravitational/teleport#51030
Closes gravitational/teleport#47231

The Docusaurus sidebar generator currently orders guides within a sidebar section by slug, which makes sidebar labels appear out of order. Instead, apply the following logic, which places page labels in the sidebar in positions where users would expect to find them:

  • Labels that include "introduction" appear first
  • Labels that include "get started" or "getting started" appear next
  • After that, labels in a sidebar section appear in alphabeitcal order

This change adds a function that modifies the order of the sidebar items returned by the default Docusaurus sidebar generation function.

Closes gravitational/teleport#51030
Closes gravitational/teleport#47231

The Docusaurus sidebar generator currently orders guides within a
sidebar section by slug, which makes sidebar labels appear out of order.
Instead, apply the following logic, which places page labels in the
sidebar in positions where users would expect to find them:

- Labels that include "introduction" appear first
- Labels that include "get started" or "getting started" appear next
- After that, labels in a sidebar section appear in alphabeitcal order

This change adds a function that modifies the order of the sidebar items
returned by the default Docusaurus sidebar generation function.
Copy link

github-actions bot commented Feb 14, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/2025-02-13-sidebar d8651b1 18 🔄RUNNING paul-gottschling-2025-02-13-sidebar 2025-02-14 23:18:16

@ptgott
Copy link
Contributor Author

ptgott commented Feb 14, 2025

Example

This example shows the Enroll Resources > Linux Servers section of the sidebar:

Current docs site This branch
image image

@ptgott ptgott requested a review from avatus February 14, 2025 23:16
@ptgott ptgott merged commit fdd3a6c into main Feb 18, 2025
5 checks passed
@ptgott ptgott deleted the paul.gottschling/2025-02-13-sidebar branch February 18, 2025 14:31
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

Successfully merging this pull request may close these issues.

Subpages of Enroll Resources in the sidebar are out of order Logically position pages in the docs sidebar
2 participants