public: sitemap
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import type { MetadataRoute } from 'next';
|
import type { MetadataRoute } from 'next';
|
||||||
|
import { getAllForSlugs } from '@/lib/for';
|
||||||
import { url } from '@/lib/layout.shared';
|
import { url } from '@/lib/layout.shared';
|
||||||
import {
|
import {
|
||||||
articleSource,
|
articleSource,
|
||||||
@@ -14,6 +15,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
const docs = await source.getPages();
|
const docs = await source.getPages();
|
||||||
const pages = await pageSource.getPages();
|
const pages = await pageSource.getPages();
|
||||||
const guides = await guideSource.getPages();
|
const guides = await guideSource.getPages();
|
||||||
|
const forSlugs = await getAllForSlugs();
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
url: url('/'),
|
url: url('/'),
|
||||||
@@ -119,5 +121,17 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
changeFrequency: 'monthly' as const,
|
changeFrequency: 'monthly' as const,
|
||||||
priority: 0.8,
|
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,
|
||||||
|
})),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user