Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions packages/core/src/utils/auto-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,6 @@ export function buildAutoNav(dir: string, basePath = '/'): any[] { // Default ba
}
}

// If no index exists at this level, and we have files, designate the first one as index
if (!indexExists && nav.length > 0) {
// Find first file (not a folder) - alphabetical after sorting (sorted below)
// But since sort hasn't happened yet, sort copies to pick the true first
const fileItems = nav.filter(n => !n.children).sort((a, b) => a.title.localeCompare(b.title));
if (fileItems.length > 0) {
const firstFile = fileItems[0];
// Store the original path before reassigning so the generator knows which file this is
firstFile._sourceFile = firstFile.path;
firstFile.path = basePath === '/' ? '/' : basePath;
}
}

// Sort: Put index.md (Home) at the top, then sort alphabetically
return nav.sort((a, b) => {
// Check if path effectively points to current folder root
Expand Down
Loading