Skip to content

Commit 662547e

Browse files
committed
feat: sitemap feature
1 parent 99d0c9e commit 662547e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/app/sitemap.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { MetadataRoute } from "next";
2+
import {
3+
mainSource,
4+
selfHostingSource,
5+
platformSource,
6+
guideSource,
7+
openApiSource,
8+
developingSource,
9+
} from "../lib/source";
10+
11+
export default function sitemap(): MetadataRoute.Sitemap {
12+
const sources = [
13+
mainSource,
14+
selfHostingSource,
15+
platformSource,
16+
guideSource,
17+
openApiSource,
18+
developingSource,
19+
];
20+
21+
return sources.flatMap((s) =>
22+
s.getPages().map((page) => ({
23+
url: `https://docs.logchimp.codecarrot.net${page.url}`,
24+
lastModified: new Date().toISOString(),
25+
})),
26+
);
27+
}

0 commit comments

Comments
 (0)