Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add root page handling in sitemap generation

Jakub Novak3fa94a3255b7
diff --git a/apps/docs/src/utils/sitemap.ts b/apps/docs/src/utils/sitemap.ts
index b40633875..449ad232d 100644
--- a/apps/docs/src/utils/sitemap.ts
+++ b/apps/docs/src/utils/sitemap.ts
@@ -15,10 +15,15 @@ export function getPageForSitemap(
return files
.map((filePath) => {
- const pathname = path
+ let pathname = path
.relative(directory, filePath)
.replace(/\/page\.mdx$/, '')
.replace(/\/page\.tsx$/, '')
+
+ if (pathname == 'page.tsx' || pathname == 'page.mdx') {
+ pathname = '/'
+ }
+
const url = new URL(pathname, urlPrefix).href
const lastModified = fs.statSync(filePath).mtime
return {