Skip to content

Commit

Permalink
chore: update sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
mfts committed Mar 17, 2024
1 parent 6a2a8c2 commit fb79949
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
42 changes: 19 additions & 23 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
import { getPostsRemote as getPosts } from "@/lib/content/blog";
import { getPosts, getAlternatives, getPages } from "@/lib/content";
import { MetadataRoute } from "next";

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const posts = await getPosts();
const blogs = posts.map((post) => ({
const solutions = await getPages();
const alternatives = await getAlternatives();
const blogLinks = posts.map((post) => ({
url: `https://www.papermark.io/blog/${post?.data.slug}`,
lastModified: new Date().toISOString().split("T")[0],
}));
const solutionLinks = solutions.map((solution) => ({
url: `https://www.papermark.io/solutions/${solution?.slug}`,
lastModified: new Date().toISOString().split("T")[0],
}));
const alternativeLinks = alternatives.map((alternative) => ({
url: `https://www.papermark.io/alternatives/${alternative?.slug}`,
lastModified: new Date().toISOString().split("T")[0],
}));

return [
{
url: "https://www.papermark.io",
lastModified: new Date().toISOString().split("T")[0],
},
{
url: "https://www.papermark.io/alternatives/docsend",
lastModified: new Date().toISOString().split("T")[0],
},
{
url: "https://www.papermark.io/alternatives/brieflink",
lastModified: new Date().toISOString().split("T")[0],
},
{
url: "https://www.papermark.io/alternatives/pandadoc",
lastModified: new Date().toISOString().split("T")[0],
},
{
url: "https://www.papermark.io/alternatives/google-drive",
lastModified: new Date().toISOString().split("T")[0],
},
{
url: "https://www.papermark.io/alternatives/pitch",
lastModified: new Date().toISOString().split("T")[0],
},
{
url: "https://www.papermark.io/privacy",
lastModified: new Date().toISOString().split("T")[0],
Expand All @@ -57,6 +47,12 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
url: "https://www.papermark.io/investors",
lastModified: new Date().toISOString().split("T")[0],
},
...blogs,
{
url: "https://www.papermark.io/blog",
lastModified: new Date().toISOString().split("T")[0],
},
...blogLinks,
...solutionLinks,
...alternativeLinks,
];
}
3 changes: 3 additions & 0 deletions lib/content/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { getAlternatives } from "./alternative";
export { getPostsRemote as getPosts } from "./blog";
export { getPages } from "./page";

0 comments on commit fb79949

Please sign in to comment.