Skip to content

fix(sitemap): skip the index entry when building page URLs - #1203

Merged
ovflowd merged 1 commit into
nodejs:mainfrom
helmipradita:fix/sitemap-skip-index-page
Oct 31, 2026
Merged

ovflowd merged 1 commit into
nodejs:mainfrom
helmipradita:fix/sitemap-skip-index-page

Conversation

@helmipradita

Copy link
Copy Markdown
Contributor

Description

Skip entry.api === 'index' when collecting depth-1 page entries in the sitemap generator so index.md is not emitted a second time via pageURL ({baseURL}/index.html) alongside the indexURL entry ({baseURL}/).

Validation

  • Added unit tests in packages/react/src/sitemap/__tests__/generate.test.mjs covering sitemap generation with and without an index entry.
  • Verified with node --test packages/react/src/sitemap/__tests__/generate.test.mjs, node --run lint, and node --run format:check.

Related Issues

Fixes #1200

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@helmipradita
helmipradita requested a review from a team as a code owner October 30, 2026 03:33
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Oct 30, 2026 3:34am UTC

Request Review

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.76%. Comparing base (060be4c) to head (e73bd38).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1203      +/-   ##
==========================================
+ Coverage   93.56%   93.76%   +0.19%     
==========================================
  Files         287      288       +1     
  Lines       28577    28622      +45     
  Branches     2882     2896      +14     
==========================================
+ Hits        26737    26836      +99     
+ Misses       1818     1764      -54     
  Partials       22       22              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

api-links Generator

Performance estimate (single CI run)

  • Generation time: 2.9% slower (1.02 s → 1.05 s)
  • Peak memory: 7.9% higher (276.75 MB → 298.59 MB)

json Generator

Performance estimate (single CI run)

  • Generation time: 7.5% faster (10.01 s → 9.26 s)
  • Peak memory: 2.3% higher (1.18 GB → 1.20 GB)

legacy-html Generator

Performance estimate (single CI run)

  • Generation time: 2.4% faster (16.78 s → 16.38 s)
  • Peak memory: 2.0% lower (1.72 GB → 1.68 GB)

legacy-json Generator

Performance estimate (single CI run)

  • Generation time: 39.4% faster (9.27 s → 5.62 s)
  • Peak memory: 0.8% higher (1.19 GB → 1.20 GB)

llms-txt Generator

Performance estimate (single CI run)

  • Generation time: 65.1% slower (4.95 s → 8.17 s)
  • Peak memory: 1.0% lower (1.27 GB → 1.26 GB)

orama-db Generator

Performance estimate (single CI run)

  • Generation time: 10.5% slower (8.09 s → 8.94 s)
  • Peak memory: 1.1% higher (1.28 GB → 1.29 GB)

web Generator

Performance estimate (single CI run)

  • Generation time: 9.9% slower (16.23 s → 17.84 s)
  • Peak memory: 8.0% lower (2.03 GB → 1.86 GB)

@ovflowd
ovflowd merged commit 0e999db into nodejs:main Oct 31, 2026
23 checks passed
@ovflowd

ovflowd commented Oct 31, 2026

Copy link
Copy Markdown
Member

Thanks @helmipradita for your first time contribution :)

@github-actions github-actions Bot mentioned this pull request Oct 31, 2026

This branch was successfully deployed

1 active deployment
Preview – api-docs-tooling — e73bd385 Deployed Oct 30, 2026 by vercel[bot]
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.

sitemap: lists the index page twice when index.md is an input

3 participants