fix(public): minor tweaks

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-11-13 22:56:07 +01:00
parent 22fe8e478e
commit b30a76165d
3 changed files with 15 additions and 8 deletions

View File

@@ -1,10 +1,11 @@
import { articleSource, source } from '@/lib/source';
import { articleSource, pageSource, source } from '@/lib/source';
import type { MetadataRoute } from 'next';
import { url } from './layout.config';
const articles = await articleSource.getPages();
const docs = await source.getPages();
export default function sitemap(): MetadataRoute.Sitemap {
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const articles = await articleSource.getPages();
const docs = await source.getPages();
const pages = await pageSource.getPages();
return [
{
url: url('/'),
@@ -36,5 +37,11 @@ export default function sitemap(): MetadataRoute.Sitemap {
changeFrequency: 'monthly' as const,
priority: 0.3,
})),
...pages.map((item) => ({
url: url(item.url),
lastModified: item.data.lastModified,
changeFrequency: 'monthly' as const,
priority: 0.3,
})),
];
}