Add redirects for canonical route cleanup (#75)#101
Conversation
Follows shakacode/react_on_rails#3067, which canonicalized four verbose docs URL slugs via Docusaurus `slug:` frontmatter. - Redirect the four legacy URLs (with and without trailing slash) to their new canonical destinations - Point the existing `/docs/guides/file-system-based-automated-bundle-generation.md` redirect directly at `/docs/core-concepts/auto-bundling/` to avoid a redirect chain - Update site-shell links (footer and `docsRoutes` constants) that still referenced the legacy `installation-into-an-existing-rails-app` slug Fixes #75
WalkthroughThis change implements canonical route cleanup by shortening verbose documentation paths (e.g., Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@prototypes/docusaurus/docusaurus.config.ts`:
- Line 146: You changed the Docusaurus nav link target to "to:
'/docs/getting-started/existing-rails-app'" in
prototypes/docusaurus/docusaurus.config.ts but this config is governed by a repo
rule requiring prior approval; revert the edit or open the PR for maintainers'
approval before committing the change. Specifically, either restore the previous
"to:" value in the navigation entry or add a note/request in the PR asking for
explicit approval from the docs/config owners so that the modification to the
nav entry (the "to" property) can be accepted.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ae8b01da-fac4-479b-b08f-a8b3fda08096
📒 Files selected for processing (3)
prototypes/docusaurus/docusaurus.config.tsprototypes/docusaurus/src/constants/docsRoutes.tsprototypes/docusaurus/static/_redirects
| { | ||
| label: 'Install into Existing Rails App', | ||
| to: '/docs/getting-started/installation-into-an-existing-rails-app', | ||
| to: '/docs/getting-started/existing-rails-app', |
There was a problem hiding this comment.
Please confirm prior approval for this Docusaurus config edit.
The link target change looks correct, but this file is covered by a repo rule requiring approval before config modifications.
As per coding guidelines: “Ask first before making changes to Docusaurus configuration (prototypes/docusaurus/docusaurus.config.ts).”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@prototypes/docusaurus/docusaurus.config.ts` at line 146, You changed the
Docusaurus nav link target to "to: '/docs/getting-started/existing-rails-app'"
in prototypes/docusaurus/docusaurus.config.ts but this config is governed by a
repo rule requiring prior approval; revert the edit or open the PR for
maintainers' approval before committing the change. Specifically, either restore
the previous "to:" value in the navigation entry or add a note/request in the PR
asking for explicit approval from the docs/config owners so that the
modification to the nav entry (the "to" property) can be accepted.
|
Cloudflare preview deployed. |
Summary
Follows shakacode/react_on_rails#3067, which canonicalized four verbose docs URL slugs via Docusaurus
slug:frontmatter. This PR wires up the site side so old URLs and site-shell links resolve to the new canonical routes.Redirects added (with and without trailing slash)
/docs/core-concepts/auto-bundling-file-system-based-automated-bundle-generation/docs/core-concepts/auto-bundling//docs/getting-started/installation-into-an-existing-rails-app/docs/getting-started/existing-rails-app//docs/building-features/how-to-conditionally-server-render-based-on-device-type/docs/building-features/conditional-server-rendering//docs/building-features/how-to-use-different-files-for-client-and-server-rendering/docs/building-features/client-server-files/Other changes
/docs/guides/file-system-based-automated-bundle-generation.mdredirect directly at/docs/core-concepts/auto-bundling/to avoid a redirect chaininstallation-into-an-existing-rails-appslug indocusaurus.config.ts(footer) anddocsRoutes.ts(used by homepage CTAs)/docs/pro/already has redirect coverage from earlier work (#71/#73) and remains the canonical Pro docs destination.Fixes #75
Test plan
node --test scripts/docs-layout.test.mjspasses🤖 Generated with Claude Code
Note
Low Risk
Low risk: docs-site link and redirect updates only; main risk is misrouted/looping redirects if any path is mistyped.
Overview
Aligns the Docusaurus site shell with newly canonicalized docs slugs by updating the footer and shared
docsRoutesconstant to use/docs/getting-started/existing-rails-appinstead of the old verbose path.Expands
static/_redirectswith 301s (with and without trailing slashes) from several legacy, long-form doc URLs to their shorter canonical routes, and updates an existing redirect to point directly at/docs/core-concepts/auto-bundling/to avoid a redirect chain.Reviewed by Cursor Bugbot for commit ec24802. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit