52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import getPostMetadata from "@/utils/getPostMetaData";
|
|
import { MetadataRoute } from "next";
|
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
const defaultPages = [
|
|
{
|
|
url: "https://fastpocket.dev",
|
|
lastModified: new Date(),
|
|
changeFrequency: "daily",
|
|
priority: 1
|
|
},
|
|
{
|
|
url: "https://fastpocket.dev/about",
|
|
lastModified: new Date(),
|
|
changeFrequency: "monthly",
|
|
priority: 0.9
|
|
},
|
|
{
|
|
url: "https://fastpocket.dev/pricing",
|
|
lastModified: new Date(),
|
|
changeFrequency: "monthly",
|
|
priority: 0.9
|
|
},
|
|
{
|
|
url: "https://fastpocket.dev/blogs",
|
|
lastModified: new Date(),
|
|
changeFrequency: "monthly",
|
|
priority: 0.9
|
|
},
|
|
{
|
|
url: "https://fastpocket.dev/whatsnew",
|
|
lastModified: new Date(),
|
|
changeFrequency: "monthly",
|
|
priority: 0.9
|
|
}
|
|
// other pages
|
|
];
|
|
|
|
const postSlugs = await getPostMetadata();
|
|
|
|
const sitemap = [
|
|
...defaultPages,
|
|
...postSlugs.map((e: any) => ({
|
|
url: `https://fastpocket.dev/blogs/${e.slug}`,
|
|
lastModified: e.modified,
|
|
changeFrequency: "daily",
|
|
priority: 0.8
|
|
} as any))
|
|
];
|
|
|
|
return sitemap;
|
|
} |