Skip to content

Commit 81a58e2

Browse files
louis-preclaude
andcommitted
Fix site section ordering so /api URLs resolve correctly
The catch-all Guides section (urlPrefix: '') was listed first, causing all /api/... URLs to match Guides instead of API Reference. Reorder so more-specific prefixes come first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b1306b2 commit 81a58e2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

codegen/lib/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ export interface SiteSection {
1616
urlPrefix: string
1717
}
1818

19+
// Order matters: more-specific prefixes must come first so that URL matching
20+
// picks the longest prefix (e.g., '/api' before the catch-all '').
1921
export const siteSections: SiteSection[] = [
20-
{ name: 'Guides', root: join('docs', 'guides'), urlPrefix: '' },
2122
{
2223
name: 'API Reference',
2324
root: join('docs', 'api-reference'),
2425
urlPrefix: '/api',
2526
},
27+
{ name: 'Guides', root: join('docs', 'guides'), urlPrefix: '' },
2628
]
2729

2830
// Convenience accessors (used by codegen)

0 commit comments

Comments
 (0)