Skip to content

Commit 30fc291

Browse files
louis-preclaude
andcommitted
fix: Remove implicit directory/README.md resolution from redirect validator
Redirect targets should always point to exact files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e3245ff commit 30fc291

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

codegen/validate-redirects.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ const redirects: Redirect[] = Object.entries(gitbookConfig.redirects ?? {}).map(
2222
function pageExists(fullPath: string): boolean {
2323
// Exact file match (e.g., quickstart.md)
2424
if (existsSync(fullPath)) return true
25-
// Directory with README.md (e.g., core-concepts/ → core-concepts/README.md)
26-
if (existsSync(join(fullPath, 'README.md'))) return true
2725
// URL-style target without .md extension (e.g., api/devices → api/devices.md)
2826
if (!fullPath.endsWith('.md') && existsSync(fullPath + '.md')) return true
2927
// README.md targets resolve as directory URLs in GitBook, so check if the

0 commit comments

Comments
 (0)