docs: document config-level redirects map#507
Closed
claude[bot] wants to merge 1 commit into
Closed
Conversation
Document the docs.json `redirects` map (shipped in #503): a central old-path -> new-destination map that returns a 307 temporary redirect on doc page loads, including deleted/moved pages, and does not affect API routes. Covered on the redirects authoring guide and added to the docs.json config reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TfgQUAgxYfQb2La2Lvbi16
|
To preview the documentation for this pull request, visit the following URL:
|
|
|
|
🚅 Deployed to the docs.page-pr-507 environment in docs.page 2 services not affected by this PR
|
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.
Requested by Elliot Hesp · Slack thread
Fixes #
Summary
The config-level
redirectsmap (shipped in #503) had no user documentation. This documents it.Before: the
redirectsmap indocs.jsonshipped in #503, but nothing in the docs told authors it existed or how it behaves.After: the redirects authoring guide and the
docs.jsonconfig reference both document the feature with examples — a central old-path -> new-destination map that returns a 307 temporary redirect on documentation page loads (including deleted/moved pages), does not affect platform API routes, and accepts root-relative, relative, or external URL destinations.Scope
app/(hosted site, MCP, Ask AI)packages/cli/packages/mdx-bundler/docs/(product documentation)Type of change
Test plan
Docs-only content change.
NODE_ENV=production bun run --cwd app build)bun dev, CLI command, or other relevant command)docs/(if user-facing)Notes for reviewers
Two pages changed:
docs/authoring/redirects.mdx— new "Redirect many URLs from docs.json" section: what the map is, when to use it vs a per-page frontmatterredirect(many/central vs one-off), adocs.jsonexample, the 307/temporary behavior, coverage of deleted/moved pages, exclusion of API routes, and the supported value forms.docs/reference/docs-json.mdx— added theredirectstop-level key to the config reference (index table + a<Property>section with description, type, and example), matching the format used for other keys.Wording verified against the shipped code:
app/src/server/config/schema.ts(redirects: z.record(z.string(), z.string())),app/src/lib/docs-redirect.ts(slash-tolerant key matching, external URLs verbatim, otherwise resolved against doc-root + ref), andapp/src/pages/[[...path]].tsx(fires on the not-found branch withpermanent: false= 307; API routes live in the App Router and never reach this catch-all).🤖 Generated with Claude Code
https://claude.ai/code/session_01TfgQUAgxYfQb2La2Lvbi16
Generated by Claude Code