Skip to content

EPMRPP-113074 || Check root (/) in the sitemap#1078

Merged
maria-hambardzumian merged 5 commits intodevelopfrom
feture/EPMRPP-113074-sitemap-adjustments
Mar 3, 2026
Merged

EPMRPP-113074 || Check root (/) in the sitemap#1078
maria-hambardzumian merged 5 commits intodevelopfrom
feture/EPMRPP-113074-sitemap-adjustments

Conversation

@maria-hambardzumian
Copy link
Contributor

@maria-hambardzumian maria-hambardzumian commented Mar 3, 2026

Summary by CodeRabbit

  • Chores
    • Increased sitemap priority to 0.9 to improve search indexing.
    • Normalized sitemap URLs to always include a trailing slash and removed duplicate entries for cleaner crawl lists.
  • Bug Fixes
    • Updated a broad set of redirect and path mappings to improve navigation and resolve broken or inconsistent links.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Warning

Rate limit exceeded

@maria-hambardzumian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 33 seconds before requesting another review.

⌛ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4d3a56b and b4653e1.

📒 Files selected for processing (1)
  • docusaurus.config.js

Walkthrough

Adds sitemap.priority: 0.9 to Docusaurus config, implements a createSitemapItems hook that appends a trailing slash to sitemap item URLs and deduplicates items by URL, and updates numerous redirect/from→to path mappings in the navigation/redirect configuration.

Changes

Cohort / File(s) Summary
Docusaurus config (sitemap + redirects)
docusaurus.config.js
Adds sitemap.priority: 0.9; introduces createSitemapItems hook that normalizes sitemap URLs by ensuring a trailing slash and removes duplicate items by URL; updates many redirect and navigation from/to path mappings (string literal adjustments).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I’m a rabbit in the config glade,
I hop each URL and add a braid,
A trailing slash, tidy and neat,
Duplicates gone — the sitemap’s complete. 🐇✨

🚥 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 directly references the specific issue (EPMRPP-113074) and clearly describes the main change: checking root (/) in the sitemap, which aligns with the changes in docusaurus.config.js.
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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feture/EPMRPP-113074-sitemap-adjustments

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

@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.

🧹 Nitpick comments (1)
docusaurus.config.js (1)

43-50: Normalize pathname instead of concatenating on the full URL string.

Current logic appends / to the raw URL. If a future item includes query/hash, canonical URL formatting can break. Prefer normalizing pathname via URL and (optionally) deduping after normalization.

♻️ Proposed refactor
           createSitemapItems: async (params) => {
             const { defaultCreateSitemapItems, ...rest } = params;
             const items = await defaultCreateSitemapItems(rest);
-            return items.map((item) => ({
-              ...item,
-              url: item.url.endsWith('/') ? item.url : `${item.url}/`,
-            }));
+            const seen = new Set();
+            return items
+              .map((item) => {
+                const normalizedUrl = new URL(item.url);
+                if (!normalizedUrl.pathname.endsWith('/')) {
+                  normalizedUrl.pathname = `${normalizedUrl.pathname}/`;
+                }
+                return {
+                  ...item,
+                  url: normalizedUrl.toString(),
+                };
+              })
+              .filter((item) => {
+                if (seen.has(item.url)) return false;
+                seen.add(item.url);
+                return true;
+              });
           },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docusaurus.config.js` around lines 43 - 50, The sitemap item URL
normalization currently appends '/' to item.url which can break when search or
hash are present; in createSitemapItems, parse each item.url with the URL
constructor (using params.siteUrl or a base) and normalize only the pathname to
ensure a single trailing slash, then reconstruct the url using the normalized
pathname plus the original search and hash (and optionally dedupe items after
normalization); update the mapping in createSitemapItems to use this URL-based
pathname normalization instead of simple string concatenation while keeping
defaultCreateSitemapItems(params) and items variable usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docusaurus.config.js`:
- Around line 43-50: The sitemap item URL normalization currently appends '/' to
item.url which can break when search or hash are present; in createSitemapItems,
parse each item.url with the URL constructor (using params.siteUrl or a base)
and normalize only the pathname to ensure a single trailing slash, then
reconstruct the url using the normalized pathname plus the original search and
hash (and optionally dedupe items after normalization); update the mapping in
createSitemapItems to use this URL-based pathname normalization instead of
simple string concatenation while keeping defaultCreateSitemapItems(params) and
items variable usage.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00dbb84 and 9fb7755.

📒 Files selected for processing (1)
  • docusaurus.config.js

Copy link

@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 `@docusaurus.config.js`:
- Around line 50-53: The current hasFileExtension regex (/\.[a-zA-Z0-9]+$/)
treats numeric-dotted version slugs like "Version24.2.0" as having a file
extension and prevents trailing-slash normalization; update the check to only
treat true file extensions (alphabetic, typical short extensions) as
extensions—for example change hasFileExtension to use a stricter pattern like
/\.[a-zA-Z]{1,5}$/ (or otherwise match known extensions) so u.pathname for
versioned slugs will not be treated as having an extension and will receive the
trailing slash via the existing u.pathname += '/' logic.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 298691d and 4d3a56b.

📒 Files selected for processing (1)
  • docusaurus.config.js

@maria-hambardzumian maria-hambardzumian merged commit 60a67b2 into develop Mar 3, 2026
2 checks passed
@maria-hambardzumian maria-hambardzumian deleted the feture/EPMRPP-113074-sitemap-adjustments branch March 3, 2026 11:35
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