Skip to content

Conversation

@Yeom-JinHo
Copy link
Contributor

Description

This PR fixes the docs prev/next navigation so it follows the sidebar order defined in docsConfig, instead of the fumadocs page tree (which is alphabetical).

By using the sidebar configuration as the source of truth, this change improves navigation consistency and ensures users move through the docs in the same order they see in the UI.

Changes

  • Prev/Next source

    • Prev/next links are now computed from docsConfig.sidebarNav, matching the sidebar flow
      (e.g. Getting Started → Templates → Components by section).
  • config/docs.ts

    • Added getFlattenedDocsNav() to flatten sidebarNav into a linear list.
    • Added getNeighboursFromConfig(currentUrl) to return the previous/next items for a given URL.
  • Doc page logic

    • app/(docs)/docs/[[...slug]]/page.tsx now:
      • Uses getNeighboursFromConfig(page.url) first.
      • Falls back to findNeighbour(source.pageTree, page.url) when the page is not listed in the config
        (e.g. new or unlisted docs).
  • URL matching

    • Normalized trailing slashes so /docs/installation and /docs/installation/ are treated as the same URL.

Motivation

  • Single source of truth

    • The sidebar already uses docsConfig.sidebarNav, while prev/next relied on fumadocs’ page tree, causing mismatches.
  • Better UX

    • Users now navigate through the docs in the same order they see in the sidebar
      (e.g. Components → Special Effects → Animations → …).
  • Easier maintenance

    • Reordering or adding docs only requires changes in config/docs.ts; prev/next updates automatically.

Breaking Changes

  • None for readers of the docs.
  • If any code relied on the previous alphabetical prev/next order from the fumadocs page tree, that order is no longer used when the page is listed in docsConfig.

Screenshots

N/A — navigation/UX fix with no visual layout changes.

@vercel
Copy link

vercel bot commented Feb 8, 2026

@Yeom-JinHo is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo
Copy link
Contributor Author

@dillionverma
This is a fairly small improvement to keep the docs navigation consistent.
I’d appreciate a review whenever you have time. Thanks!

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.

1 participant