From 375c63882b88fefda85332abeef7fc02928044bd Mon Sep 17 00:00:00 2001 From: Mateus Silva Date: Tue, 6 Jan 2026 15:44:19 +0000 Subject: [PATCH] fix(sitemap): remove layout routes from the sitemap list --- src/remix/sitemap.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/remix/sitemap.ts b/src/remix/sitemap.ts index 33a4281..0341cea 100644 --- a/src/remix/sitemap.ts +++ b/src/remix/sitemap.ts @@ -35,12 +35,17 @@ const convertRemixPathToUrl = (routes: RouteManifest, route: } const createExtendedRoutes = (routes: RouteManifest) => { - return Object.values(routes).map((route) => { - return { - ...route, - url: convertRemixPathToUrl(routes, route), - } - }) + return Object.values(routes) + .filter((route) => { + // Filter out layouts from the routes + return route?.path !== undefined || route?.index + }) + .map((route) => { + return { + ...route, + url: convertRemixPathToUrl(routes, route), + } + }) } const generateRemixSitemapRoutes = async ({ domain,