docs(gitbook): key redirects by old file path, drop self-redirects - #62
Merged
Conversation
Verified against the deployed site: 31 of 58 changed URLs 404. Every URL that still resolves does so through GitBook's own page tracking, which follows a page when its file is unchanged or its rename is detected — none of the configured redirects fired. The block mixed two key forms per page and included 12 self-redirects for pages whose file never moved, which likely invalidated it. Emit one entry per genuine file move, keyed by the old repo-relative path, per the documented format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the redirects added in #61. 31 of the 58 changed URLs currently 404 on the live site.
Problem
Measured after #61 deployed: 27 of 58 old URLs resolve, 31 return 404. Every one that resolves is explained by GitBook's own page tracking — it follows a page when the file is unchanged (all 12 nav-only moves pass) or when it detects the rename (15 of 46 file moves). None of the configured redirects fired.
The block was keyed on site URLs rather than repo paths, emitted two keys per page, and included 12 self-redirects (
path: path.md) for pages whose file never moved. GitBook documents the format asprevious/page: new-folder/page.md— repo-relative file paths — so the extra forms were at best inert and the self-redirects plausibly invalidated the whole block.Solution
One entry per genuine file move, keyed by the old repo-relative path with
.mdstripped and a README keyed by its directory. Self-redirects dropped, since those pages already resolve through page tracking.Needs verification against the deployed site again after merge — the same 58 URLs, expecting 0 failures.