docs: document the docs.json redirects map#508
Merged
Conversation
|
To preview the documentation for this pull request, visit the following URL:
|
|
|
|
🚅 Deployed to the docs.page-pr-508 environment in docs.page 2 services not affected by this PR
|
Ehesp
approved these changes
Jul 3, 2026
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 Ben Cook · Slack thread
Summary
Before: the docs only described per-page
redirect:frontmatter and explicitly stated that redirects are "not a central table indocs.json" (and that there are "no wildcard or catch-all rules indocs.json").After: the docs also document the supported centralized
docs.jsonredirectsobject-map — its 307 Temporary Redirect behavior, external-URL support (http(s)://///values returned unchanged), and the important 404-branch-only caveat: the map is consulted only when no.mdxfile exists at the requested path (a deleted/moved page). If a file still lives at that path, its own frontmatterredirectgoverns and the config map is not consulted.How
docs/reference/docs-json.mdx— addedredirectsto the field overview table and a full## redirectssection showing the{ "from": "to" }object-map shape, an example, internal/external value rules, the 307 status, and the 404-branch-only behavior.docs/features/redirects.mdx— corrected the stale "per page file, not a central table indocs.json" sentence and the "no wildcard or catch-all rules indocs.json" table row; added a "The centralized redirects map" section covering the 404-branch-only behavior, 307 status, and internal/external destinations.docs/authoring/redirects.mdx— added a "Forward deleted pages in bulk" section recommending thedocs.jsonmap for removed pages, and noted the alternative in the stub callout, while keeping the frontmatter-stub guidance for the keep-a-file case.Source of truth: schema at
app/src/server/config/schema.ts:43(redirects: z.record(z.string(), z.string()).catch({})) and runtimeresolveConfigRedirectDestinationinapp/src/lib/docs-redirect.ts, called on the not-found (404) branch fromapp/src/pages/[[...path]].tsx. Theredirectskey is already emitted in the generated/schema.jsonbecause that schema is derived fromConfigSchema, so no separate JSON file needed updating.Scope
app/(hosted site, MCP, Ask AI)packages/cli/packages/mdx-bundler/docs/(product documentation)Type of change
Test plan
Docs-only change; no runtime behavior touched.
bun run checkpasses locallydocs/(if user-facing)Notes for reviewers
Documentation-only. All documented behavior was verified against the schema and runtime cited above — no behavior was invented. Anchor links (
#the-centralized-redirects-map,#redirects,#forward-deleted-pages-in-bulk) assume the standard slugger (lowercase, spaces to hyphens, punctuation stripped); please confirm they resolve in preview.Generated by Claude Code