From 67f413c43ad0c4707840a8bc3d21c28a9de784a6 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Thu, 1 Oct 2026 09:54:32 -0400 Subject: [PATCH] fix: sitemap url --- .changeset/sitemap-absolute-urls.md | 6 ++++++ packages/node/src/config/index.mjs | 1 + packages/react/src/sitemap/README.md | 7 ++++--- packages/react/src/sitemap/index.mjs | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changeset/sitemap-absolute-urls.md diff --git a/.changeset/sitemap-absolute-urls.md b/.changeset/sitemap-absolute-urls.md new file mode 100644 index 000000000..9ab617937 --- /dev/null +++ b/.changeset/sitemap-absolute-urls.md @@ -0,0 +1,6 @@ +--- +'@doc-kit/generator-react': patch +'@node-core/doc-kit': patch +--- + +fix(sitemap): emit fully resolved page URLs diff --git a/packages/node/src/config/index.mjs b/packages/node/src/config/index.mjs index b6b39ed1a..07d152b01 100644 --- a/packages/node/src/config/index.mjs +++ b/packages/node/src/config/index.mjs @@ -82,5 +82,6 @@ export default { sitemap: { indexURL: '{baseURL}/latest/api/', + pageURL: '{baseURL}/latest/api{path}.html', }, }; diff --git a/packages/react/src/sitemap/README.md b/packages/react/src/sitemap/README.md index a0a3543ef..71e47ba31 100644 --- a/packages/react/src/sitemap/README.md +++ b/packages/react/src/sitemap/README.md @@ -6,6 +6,7 @@ The `sitemap` generator creates a `sitemap.xml` file for search engine optimizat - `output` {string} The directory where `sitemap.xml` will be written. - `indexURL` {string} URL template for the API documentation index page. - **Default:** `'{baseURL}/latest/api/'`. -- `pageURL` {string} URL template for individual documentation pages. - **Default:** `'{indexURL}{path}.html'`. + **Default:** `'{baseURL}/'`. +- `pageURL` {string} URL template for individual documentation pages. `{path}` + is the page's extensionless path and starts with a slash + **Default:** `'{baseURL}{path}.html'`. diff --git a/packages/react/src/sitemap/index.mjs b/packages/react/src/sitemap/index.mjs index 34b4421aa..8c956675c 100644 --- a/packages/react/src/sitemap/index.mjs +++ b/packages/react/src/sitemap/index.mjs @@ -16,7 +16,7 @@ export default { defaultConfiguration: { indexURL: '{baseURL}/', - pageURL: '{indexURL}{path}.html', + pageURL: '{baseURL}{path}.html', }, generate,