-
Notifications
You must be signed in to change notification settings - Fork 298
fix: Improve SEO canonicalization and block non-indexable pages #2706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds SEO controls across the app: a new middleware (seoOptimization) injects an Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/routes/robots.txt/`+server.ts:
- Line 26: Remove the unnecessary backslashes used to escape double quotes
inside the template literal that builds the robots.txt content (the literal that
blocks versioned docs and references "cloud"); change occurrences of \"cloud\"
(and any other \"...\" instances) to plain "cloud" (and "..." respectively) so
the template uses normal double quotes within the template literal, then re-run
linting to ensure ESLint warnings are resolved.
🧹 Nitpick comments (1)
src/routes/robots.txt/+server.ts (1)
27-33: Consider future-proofing version blocking.The current approach explicitly blocks versions starting with
0,1,2,3. If new major versions (e.g.,4.x,5.x) are released in the future, additionalDisallowrules would need to be added manually.An alternative approach would be to invert the logic—disallow all of
/docs/references/and then explicitly allow only/docs/references/cloud/. However, robots.txt precedence rules vary by crawler (Google uses most-specific-wins, others may use first-match), so the current explicit approach is safer and more predictable.
| Disallow: /console/register | ||
| Disallow: /v1/ | ||
| # Block all versioned docs references; only \"cloud\" should be indexable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary escape characters in template literal.
In JavaScript template literals, double quotes don't require escaping. The backslashes before the quotes are unnecessary and trigger ESLint errors.
Proposed fix
-# Block all versioned docs references; only \"cloud\" should be indexable
+# Block all versioned docs references; only "cloud" should be indexable📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Block all versioned docs references; only \"cloud\" should be indexable | |
| # Block all versioned docs references; only "cloud" should be indexable |
🧰 Tools
🪛 ESLint
[error] 26-26: Unnecessary escape character: ".
(no-useless-escape)
[error] 26-26: Unnecessary escape character: ".
(no-useless-escape)
🤖 Prompt for AI Agents
In `@src/routes/robots.txt/`+server.ts at line 26, Remove the unnecessary
backslashes used to escape double quotes inside the template literal that builds
the robots.txt content (the literal that blocks versioned docs and references
"cloud"); change occurrences of \"cloud\" (and any other \"...\" instances) to
plain "cloud" (and "..." respectively) so the template uses normal double quotes
within the template literal, then re-run linting to ensure ESLint warnings are
resolved.
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.