Skip to content

Commit c68b224

Browse files
committed
generate robots.txt and sitemap.xml
1 parent 7f4bc7b commit c68b224

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

apps/docs/src/app/robots.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { MetadataRoute } from "next"
2+
3+
export default function robots(): MetadataRoute.Robots {
4+
return {
5+
rules: {
6+
userAgent: "*",
7+
allow: "/",
8+
},
9+
sitemap: "https://vorsteh-queue.dev/sitemap.xml",
10+
}
11+
}

apps/docs/src/app/sitemap.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { MetadataRoute } from "next"
2+
3+
import { transformedEntries } from "~/collections"
4+
5+
export const dynamic = "force-static"
6+
7+
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
8+
const links = await transformedEntries()
9+
10+
return links.map((link) => {
11+
return {
12+
url: `https://vorsteh-queue.dev${link.raw_pathname}`,
13+
lastModified: new Date(),
14+
}
15+
})
16+
}

0 commit comments

Comments
 (0)