Skip to content

Commit 96d3048

Browse files
louis-preclaude
andcommitted
chore: Remove README.md→parent.md fallback from redirect validator
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d2f412a commit 96d3048

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

codegen/validate-redirects.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ const redirects: Redirect[] = Object.entries(gitbookConfig.redirects ?? {}).map(
1919
)
2020

2121
function pageExists(fullPath: string): boolean {
22-
if (existsSync(fullPath) && statSync(fullPath).isFile()) return true
23-
if (fullPath.endsWith('/README.md')) {
24-
const parentPath = fullPath.slice(0, -'/README.md'.length)
25-
if (existsSync(parentPath + '.md')) return true
26-
}
27-
return false
22+
return existsSync(fullPath) && statSync(fullPath).isFile()
2823
}
2924

3025
function resolveTarget(target: string): boolean {

0 commit comments

Comments
 (0)