Skip to content

fix: update /docs/v1/ redirect to latest v1.2#492

Merged
myasnikovdaniil merged 2 commits intomainfrom
fix/v1-redirect-alias
Apr 16, 2026
Merged

fix: update /docs/v1/ redirect to latest v1.2#492
myasnikovdaniil merged 2 commits intomainfrom
fix/v1-redirect-alias

Conversation

@myasnikovdaniil
Copy link
Copy Markdown
Contributor

@myasnikovdaniil myasnikovdaniil commented Apr 16, 2026

Summary

  • Update Netlify redirect /docs/v1/*/docs/v1.2/:splat (was pointing to outdated v1.0)
  • Add Hugo alias /docs/v1/ on the v1.2 docs index for GitHub Pages compatibility

Test plan

  • Verify /docs/v1/ redirects to /docs/v1.2/
  • Verify /docs/v1/some-page/ redirects to /docs/v1.2/some-page/

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated documentation routing: /docs/v1/ now directs to v1.2 documentation instead of v1.0
    • Enhanced handling of outdated documentation links with automatic redirects to current versions
  • Chores

    • Updated deployment configuration and clarified production behavior

The Netlify redirect for /docs/v1/* was pointing to the outdated v1.0.
Also adds a Hugo alias on the v1.2 index for GitHub Pages compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@myasnikovdaniil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 44 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 42 minutes and 44 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8adadd11-f132-49e2-a6b3-b55bff347244

📥 Commits

Reviewing files that changed from the base of the PR and between eae121f and 0926d5c.

📒 Files selected for processing (3)
  • CLAUDE.md
  • content/en/docs/v1.0/_index.md
  • layouts/404.html
📝 Walkthrough

Walkthrough

This change relocates the default short-form /docs/v1/ documentation alias from v1.0 to v1.2, adds JavaScript-based version redirect fallback logic to the 404 page, updates the Netlify redirect rule accordingly, and clarifies that production deployment relies on GitHub Pages with Hugo mechanisms only.

Changes

Cohort / File(s) Summary
Documentation & Deployment Clarification
CLAUDE.md
Updated deployment guidance to explicitly state GitHub Pages serves production while Netlify handles PR deploy previews; redirects should use Hugo aliases or 404.html JavaScript fallback instead of netlify.toml features.
Version Aliasing
content/en/docs/v1.0/_index.md, content/en/docs/v1.2/_index.md
Removed /docs/v1/ alias from v1.0 and added it to v1.2, making v1.2 the default short-form version target.
Redirect Mechanisms
layouts/404.html, netlify.toml
Added JavaScript fallback in 404 page to redirect short-form version paths to latest version using site configuration; updated Netlify redirect rule from v1.0 to v1.2 target.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 We hop through docs with care and grace,
From v1.0 to v1.2's place,
A JavaScript catch for paths gone astray,
And Netlify rules updated today!
Version aliases march in line—
The documentation's feeling fine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: updating the /docs/v1/ redirect to point to v1.2 instead of v1.0.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v1-redirect-alias

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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for cozystack ready!

Name Link
🔨 Latest commit 0926d5c
🔍 Latest deploy log https://app.netlify.com/projects/cozystack/deploys/69e095a132b78d00080351e6
😎 Deploy Preview https://deploy-preview-492--cozystack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation versioning by adding an alias for /docs/v1/ in the v1.2 index file and updating the Netlify redirect rule to point /docs/v1/* to the v1.2 documentation. Feedback was provided to improve the redirect logic in netlify.toml by adding force = true to prevent conflicts with Hugo-generated files and adding an explicit redirect for the base path /docs/v1 to ensure consistent behavior.

Comment thread netlify.toml
Copy link
Copy Markdown
Contributor

@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 `@layouts/404.html`:
- Line 10: The fallback redirect currently uses window.location.pathname only
(window.location.replace(window.location.pathname.replace(shortPrefix,
fullPrefix))) which drops the query string and hash; update the logic in this
redirect to reconstruct the full current location by taking
window.location.pathname, appending window.location.search and
window.location.hash, perform the same replace on the pathname portion (using
shortPrefix and fullPrefix) and then call window.location.replace with the
rebuilt URL so query parameters and fragment are preserved.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1883ee5d-2b42-4551-ab54-bc3e22358bca

📥 Commits

Reviewing files that changed from the base of the PR and between 01853da and eae121f.

📒 Files selected for processing (5)
  • CLAUDE.md
  • content/en/docs/v1.0/_index.md
  • content/en/docs/v1.2/_index.md
  • layouts/404.html
  • netlify.toml
💤 Files with no reviewable changes (1)
  • content/en/docs/v1.0/_index.md

Comment thread layouts/404.html
Production is served by GitHub Pages, not Netlify, so netlify.toml
redirects don't work. Add JS redirect in 404.html that maps
/docs/v1/<path> → /docs/v1.2/<path> using the latest_version_id param.
Also remove the stale /docs/v1/ alias from v1.0 _index.md (moved to
v1.2 in the prior commit) and document the GitHub Pages constraint in
CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@myasnikovdaniil myasnikovdaniil merged commit cbea500 into main Apr 16, 2026
6 checks passed
@myasnikovdaniil myasnikovdaniil deleted the fix/v1-redirect-alias branch April 16, 2026 08:46
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.

2 participants