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,