Skip to content

Commit fb79949

Browse files
committed
chore: update sitemap
1 parent 6a2a8c2 commit fb79949

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

app/sitemap.ts

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,28 @@
1-
import { getPostsRemote as getPosts } from "@/lib/content/blog";
1+
import { getPosts, getAlternatives, getPages } from "@/lib/content";
22
import { MetadataRoute } from "next";
33

44
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
55
const posts = await getPosts();
6-
const blogs = posts.map((post) => ({
6+
const solutions = await getPages();
7+
const alternatives = await getAlternatives();
8+
const blogLinks = posts.map((post) => ({
79
url: `https://www.papermark.io/blog/${post?.data.slug}`,
810
lastModified: new Date().toISOString().split("T")[0],
911
}));
12+
const solutionLinks = solutions.map((solution) => ({
13+
url: `https://www.papermark.io/solutions/${solution?.slug}`,
14+
lastModified: new Date().toISOString().split("T")[0],
15+
}));
16+
const alternativeLinks = alternatives.map((alternative) => ({
17+
url: `https://www.papermark.io/alternatives/${alternative?.slug}`,
18+
lastModified: new Date().toISOString().split("T")[0],
19+
}));
1020

1121
return [
1222
{
1323
url: "https://www.papermark.io",
1424
lastModified: new Date().toISOString().split("T")[0],
1525
},
16-
{
17-
url: "https://www.papermark.io/alternatives/docsend",
18-
lastModified: new Date().toISOString().split("T")[0],
19-
},
20-
{
21-
url: "https://www.papermark.io/alternatives/brieflink",
22-
lastModified: new Date().toISOString().split("T")[0],
23-
},
24-
{
25-
url: "https://www.papermark.io/alternatives/pandadoc",
26-
lastModified: new Date().toISOString().split("T")[0],
27-
},
28-
{
29-
url: "https://www.papermark.io/alternatives/google-drive",
30-
lastModified: new Date().toISOString().split("T")[0],
31-
},
32-
{
33-
url: "https://www.papermark.io/alternatives/pitch",
34-
lastModified: new Date().toISOString().split("T")[0],
35-
},
3626
{
3727
url: "https://www.papermark.io/privacy",
3828
lastModified: new Date().toISOString().split("T")[0],
@@ -57,6 +47,12 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
5747
url: "https://www.papermark.io/investors",
5848
lastModified: new Date().toISOString().split("T")[0],
5949
},
60-
...blogs,
50+
{
51+
url: "https://www.papermark.io/blog",
52+
lastModified: new Date().toISOString().split("T")[0],
53+
},
54+
...blogLinks,
55+
...solutionLinks,
56+
...alternativeLinks,
6157
];
6258
}

lib/content/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export { getAlternatives } from "./alternative";
2+
export { getPostsRemote as getPosts } from "./blog";
3+
export { getPages } from "./page";

0 commit comments

Comments
 (0)