Skip to content

Sitemap: Exclude /docs/api/** URLs#3122

Merged
reakaleek merged 1 commit intomainfrom
troubled-lime
Apr 16, 2026
Merged

Sitemap: Exclude /docs/api/** URLs#3122
reakaleek merged 1 commit intomainfrom
troubled-lime

Conversation

@reakaleek
Copy link
Copy Markdown
Member

What

Exclude all /docs/api/** URLs from the generated sitemap.

Why

API docs should not appear in the sitemap for now.

How

Filter entries with /docs/api/ prefix in SitemapBuilder.Generate() — the single method both the build-time and production sitemap paths funnel through.

Test plan

  • dotnet test --filter SitemapTests — all 7 tests pass including new Generate_ExcludesApiDocsFromSitemap

Notes

Marked with a TODO comment for easy removal when API docs are ready for sitemap inclusion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@reakaleek reakaleek requested a review from a team as a code owner April 16, 2026 07:48
@reakaleek reakaleek requested review from Mpdreamz and technige April 16, 2026 07:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c9a8aca9-11b0-4e38-8f8c-387694735e62

📥 Commits

Reviewing files that changed from the base of the PR and between 96e731b and e060ed9.

📒 Files selected for processing (2)
  • src/services/Elastic.Documentation.Assembler/Building/SitemapBuilder.cs
  • tests/Elastic.Documentation.Build.Tests/SitemapTests.cs

📝 Walkthrough

Walkthrough

The pull request modifies the sitemap generation logic to exclude API documentation paths from the generated sitemap. The SitemapBuilder.Generate method now filters the input entries collection, removing any entries whose keys start with /docs/api/ using ordinal string comparison, before the XML generation pipeline processes them. A corresponding test was added to verify that API documentation entries are excluded while non-API documentation entries are retained in the output.

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: excluding /docs/api/** URLs from the sitemap.
Description check ✅ Passed The description comprehensively explains what changed, why it matters, how it was implemented, and includes test results.
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
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch troubled-lime

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

@reakaleek reakaleek merged commit 73eae13 into main Apr 16, 2026
28 of 29 checks passed
@reakaleek reakaleek deleted the troubled-lime branch April 16, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants