Skip to content

fix: resolve next/prev navigation on index pages#537

Merged
berry-13 merged 1 commit into
mainfrom
fix/next-navigation-index-pages
Mar 21, 2026
Merged

fix: resolve next/prev navigation on index pages#537
berry-13 merged 1 commit into
mainfrom
fix/next-navigation-index-pages

Conversation

@berry-13
Copy link
Copy Markdown
Member

Closes #533

Problem

The "Next" navigation link on index/overview pages pointed back to the same page instead of the first child page. This affected all folder index pages, including:

  • /docs/local
  • /docs/remote
  • /docs/configuration
  • /docs/configuration/authentication
  • /docs/configuration/pre_configured_ai
  • /docs/configuration/tools
  • and all other folder index pages

Root cause

Every folder meta.json explicitly listed "index" in its pages array. Fumadocs already registers index.mdx as the folder index page automatically. Listing it again in pages caused it to appear twice in the flat navigation list — once as the folder index entry and once as a child page entry.

When fumadocs built the prev/next links, findIndex matched the first occurrence, so next resolved to the second (duplicate) entry with the same URL — the page linked to itself.

Fix

Removed "index" from the pages array in all 18 folder meta.json files. Fumadocs handles the index page without needing it explicitly listed.

Verified

Tested locally on all pages reported in the issue — "Next" now correctly navigates to the first child page.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
librechat-ai Ready Ready Preview, Comment Mar 21, 2026 3:14pm

Request Review

@github-actions
Copy link
Copy Markdown

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

… navigation

Closes #533

Folder meta.json files listed "index" explicitly in the pages array,
causing fumadocs to include the index page twice in the flat navigation
list — once as the folder index and once as a child page. This made the
"Next" link on index/overview pages point back to themselves instead of
the first child page.

Fix: remove "index" from the pages array in all folder meta.json files.
Fumadocs automatically uses index.mdx as the folder index page without
needing it listed in pages.
@github-actions
Copy link
Copy Markdown

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@berry-13 berry-13 merged commit 5a0b761 into main Mar 21, 2026
3 checks passed
@berry-13 berry-13 deleted the fix/next-navigation-index-pages branch March 21, 2026 15:15
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.

some pages "next" navigation doesn't work

1 participant