Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Omit excluded pages from sitemap generation (#2579)

Ivan Starkov437d23f4d7a7
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[sitemap.xml].ts b/fixtures/webstudio-remix-vercel/app/__generated__/[sitemap.xml].ts
index 1e2aae4c79..b819700c09 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[sitemap.xml].ts
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[sitemap.xml].ts
@@ -4,10 +4,6 @@ export const sitemap = {
path: "",
lastModified: "2023-11-03T13:22:34.879Z",
},
- {
- path: "/radix",
- lastModified: "2023-11-03T13:22:34.879Z",
- },
{
path: "/_route_with_symbols_",
lastModified: "2023-11-03T13:22:34.879Z",
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index 2e5b58687d..baa326f3f7 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -566,10 +566,12 @@ ${utilsExport}
`
export const sitemap = ${JSON.stringify(
{
- pages: siteData.pages.map((page) => ({
- path: page.path,
- lastModified: siteData.build.updatedAt,
- })),
+ pages: siteData.pages
+ .filter((page) => page.meta.excludePageFromSearch !== true)
+ .map((page) => ({
+ path: page.path,
+ lastModified: siteData.build.updatedAt,
+ })),
},
null,
2