Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/remix/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ const convertRemixPathToUrl = (routes: RouteManifest<Route | undefined>, route:
}

const createExtendedRoutes = (routes: RouteManifest<InternalServerRoute | undefined>) => {
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
})
Comment on lines +38 to +42
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that ignore all child routes here? I think in the case of a layout route, all children should be spread into the parent for processing.

Copy link
Copy Markdown
Author

@mateussilva92 mateussilva92 Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. If that was the case the old code would have ignore them already since it only goes one level deep. The routes used here should come from virtual:react-router/server-build which already has all the routes flattened so none of the routes have any children, this can even be checked on the type of InternalServerRoute which even omits the children.

.map((route) => {
return {
...route,
url: convertRemixPathToUrl(routes, route),
}
})
}
const generateRemixSitemapRoutes = async ({
domain,
Expand Down