Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

public: sitemap

Carl-Gerhard Lindesvärd8db5905fb5ab
diff --git a/apps/public/src/app/sitemap.ts b/apps/public/src/app/sitemap.ts
index 05f215501..b1ddb6a39 100644
--- a/apps/public/src/app/sitemap.ts
+++ b/apps/public/src/app/sitemap.ts
@@ -1,4 +1,5 @@
import type { MetadataRoute } from 'next';
+import { getAllForSlugs } from '@/lib/for';
import { url } from '@/lib/layout.shared';
import {
articleSource,
@@ -14,6 +15,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const docs = await source.getPages();
const pages = await pageSource.getPages();
const guides = await guideSource.getPages();
+ const forSlugs = await getAllForSlugs();
return [
{
url: url('/'),
@@ -119,5 +121,17 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
changeFrequency: 'monthly' as const,
priority: 0.8,
})),
+ {
+ url: url('/for'),
+ lastModified: new Date(),
+ changeFrequency: 'monthly' as const,
+ priority: 0.7,
+ },
+ ...forSlugs.map((slug) => ({
+ url: url(`/for/${slug}`),
+ lastModified: new Date(),
+ changeFrequency: 'monthly' as const,
+ priority: 0.8,
+ })),
];
}