Skip to content

Commit 3e0c29f

Browse files
committed
CR
1 parent 112ec5b commit 3e0c29f

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/app/sitemap.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
import type { MetadataRoute } from "next";
2-
32
import { getAllRFSData } from "@/app/agents/utils/get-rfs-data";
43
import { PATHS } from "@/constants/paths";
54
import { BASE_URL } from "@/constants/site-metadata";
6-
75
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
8-
const staticRoutes = getStaticRoutes();
9-
const agentRoutes = await getAgentRoutes();
10-
11-
return [...staticRoutes, ...agentRoutes];
12-
}
6+
const lastModified = new Date();
137

14-
const lastModified = new Date();
15-
16-
function getStaticRoutes() {
17-
return Object.values(PATHS).map(({ path }) => ({
8+
const staticRoutes = Object.values(PATHS).map(({ path }) => ({
189
url: `${BASE_URL}${path}`,
1910
lastModified,
2011
changeFrequency: "weekly" as const,
2112
priority: path === "/" ? 1 : 0.8,
2213
}));
23-
}
2414

25-
async function getAgentRoutes() {
2615
const allRFSData = await getAllRFSData();
27-
28-
return allRFSData.map(({ slug }) => ({
16+
const agentRoutes = allRFSData.map(({ slug }) => ({
2917
url: `${BASE_URL}${PATHS.AGENTS.path}/${slug}`,
3018
lastModified,
3119
changeFrequency: "weekly" as const,
3220
priority: 0.7,
3321
}));
22+
23+
return [...staticRoutes, ...agentRoutes];
3424
}

0 commit comments

Comments
 (0)