Skip to content

Respect sidebar_label when ordering the sidebar #225

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented May 20, 2025

The sidebar_label frontmatter field specifies the name to give a docs page on the auto-generated sidebar. Our custom sidebar ordering logic does not take sidebar_label into account when ordering sidebar items automatically by title. This change uses the sidebar_label value as the page's title if this frontmatter field is available. This way, sidebar labels continue to be sorted alphabetically unless the user overrides them with sidebar_position or the title includes "Introduction" or "Get Started".

This change also renames frontmatter to frontMatter in the docPage type to match the data structure passed by Docusaurus.

The `sidebar_label` frontmatter field specifies the name to give a docs
page on the auto-generated sidebar. Our custom sidebar ordering logic
does not take `sidebar_label` into account when ordering sidebar items
automatically by title. This change uses the `sidebar_label` value as
the page's title if this frontmatter field is available. This way,
sidebar labels continue to be sorted alphabetically unless the user
overrides them with `sidebar_position` or the title includes
"Introduction" or "Get Started".

This change also renames `frontmatter` to `frontMatter` in the `docPage`
type to match the data structure passed by Docusaurus.
@ptgott ptgott temporarily deployed to docs-amplify May 20, 2025 21:13 — with GitHub Actions Inactive
@ptgott ptgott requested a review from avatus May 20, 2025 21:13
Copy link

github-actions bot commented May 20, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/2025-05-20-sidebar-label e13026e 2 🔄RUNNING paul-gottschling-2025-05-20-sidebar-label 2025-05-20 21:25:42

@ptgott ptgott added this pull request to the merge queue May 21, 2025
Merged via the queue into main with commit 86a7527 May 21, 2025
6 checks passed
@ptgott ptgott deleted the paul.gottschling/2025-05-20-sidebar-label branch May 21, 2025 15:46
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.

2 participants