Skip to content

Commit 1807b93

Browse files
committed
CR
1 parent 112ec5b commit 1807b93

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/app/sitemap.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
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";
65

76
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
8-
const staticRoutes = getStaticRoutes();
9-
const agentRoutes = await getAgentRoutes();
10-
11-
return [...staticRoutes, ...agentRoutes];
12-
}
13-
14-
const lastModified = new Date();
7+
const lastModified = new Date();
158

16-
function getStaticRoutes() {
17-
return Object.values(PATHS).map(({ path }) => ({
9+
const staticRoutes = Object.values(PATHS).map(({ path }) => ({
1810
url: `${BASE_URL}${path}`,
1911
lastModified,
2012
changeFrequency: "weekly" as const,
2113
priority: path === "/" ? 1 : 0.8,
2214
}));
23-
}
2415

25-
async function getAgentRoutes() {
2616
const allRFSData = await getAllRFSData();
27-
28-
return allRFSData.map(({ slug }) => ({
17+
const agentRoutes = allRFSData.map(({ slug }) => ({
2918
url: `${BASE_URL}${PATHS.AGENTS.path}/${slug}`,
3019
lastModified,
3120
changeFrequency: "weekly" as const,
3221
priority: 0.7,
3322
}));
23+
24+
return [...staticRoutes, ...agentRoutes];
3425
}

0 commit comments

Comments
 (0)