Skip to content

Add redirects for canonical route cleanup (#75)#101

Merged
justin808 merged 1 commit intomainfrom
jg/75-canonical-route-redirects
Apr 18, 2026
Merged

Add redirects for canonical route cleanup (#75)#101
justin808 merged 1 commit intomainfrom
jg/75-canonical-route-redirects

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Apr 18, 2026

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)

Legacy path Canonical path
/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

  • 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 references to the old installation-into-an-existing-rails-app slug in docusaurus.config.ts (footer) and docsRoutes.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.mjs passes
  • After deploy, verify each legacy URL returns 301 to the canonical destination
  • After deploy, verify homepage footer "Install into Existing Rails App" link resolves without a redirect hop

🤖 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 docsRoutes constant to use /docs/getting-started/existing-rails-app instead of the old verbose path.

Expands static/_redirects with 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

  • Documentation
    • Simplified documentation URL routes with shorter, cleaner paths
    • Added automatic redirects from legacy documentation paths to new canonical locations, ensuring existing links continue to work
    • Enhanced URL structure for better navigation

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Walkthrough

This change implements canonical route cleanup by shortening verbose documentation paths (e.g., installation-into-an-existing-rails-app becomes existing-rails-app), updates internal route references to match, and adds 301 redirect rules to preserve backward compatibility for legacy paths.

Changes

Cohort / File(s) Summary
Route Reference Updates
prototypes/docusaurus/docusaurus.config.ts, prototypes/docusaurus/src/constants/docsRoutes.ts
Updated installExistingApp documentation route from verbose path to shortened canonical path: /docs/getting-started/existing-rails-app.
Redirect Configuration
prototypes/docusaurus/static/_redirects
Added 11 new 301 redirect rules for canonical route cleanup, mapping legacy documentation paths to new shorter URLs for auto-bundling, existing-rails-app installation, and building-features sections, including variants with and without trailing slashes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hop skip and a bound,
Routes got their shortening found,
Old paths now redirect with grace,
Shorter names claim their place!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add redirects for canonical route cleanup (#75)' clearly and concisely describes the main change—adding redirects to support canonical route cleanup as tracked in issue #75.
Linked Issues check ✅ Passed The PR successfully implements all coding-related acceptance criteria from issue #75: adds redirect coverage for canonical-route changes, updates hardcoded route references in docusaurus.config.ts and docsRoutes.ts, maintains /docs/pro/ as canonical, and verifies with test scripts.
Out of Scope Changes check ✅ Passed All changes are in scope: redirect additions in _redirects file, route constant updates in docsRoutes.ts, and footer link updates in docusaurus.config.ts directly support the issue #75 objectives without unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/75-canonical-route-redirects

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f9d4cd3 and ec24802.

📒 Files selected for processing (3)
  • prototypes/docusaurus/docusaurus.config.ts
  • prototypes/docusaurus/src/constants/docsRoutes.ts
  • prototypes/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',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

@github-actions
Copy link
Copy Markdown

@justin808 justin808 merged commit 774b368 into main Apr 18, 2026
4 checks passed
@justin808 justin808 deleted the jg/75-canonical-route-redirects branch April 18, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs redirects follow-up: support canonical route cleanup from react_on_rails

1 participant