docs: add guides to sitemap
This commit is contained in:
@@ -1,11 +1,18 @@
|
|||||||
import { url } from '@/lib/layout.shared';
|
import { url } from '@/lib/layout.shared';
|
||||||
import { articleSource, compareSource, pageSource, source } from '@/lib/source';
|
import {
|
||||||
|
articleSource,
|
||||||
|
compareSource,
|
||||||
|
guideSource,
|
||||||
|
pageSource,
|
||||||
|
source,
|
||||||
|
} from '@/lib/source';
|
||||||
import type { MetadataRoute } from 'next';
|
import type { MetadataRoute } from 'next';
|
||||||
|
|
||||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||||
const articles = await articleSource.getPages();
|
const articles = await articleSource.getPages();
|
||||||
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();
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
url: url('/'),
|
url: url('/'),
|
||||||
@@ -49,6 +56,12 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
changeFrequency: 'yearly' as const,
|
changeFrequency: 'yearly' as const,
|
||||||
priority: 0.5,
|
priority: 0.5,
|
||||||
})),
|
})),
|
||||||
|
...guides.map((item) => ({
|
||||||
|
url: url(item.url),
|
||||||
|
lastModified: item.data.date,
|
||||||
|
changeFrequency: 'monthly' as const,
|
||||||
|
priority: 0.5,
|
||||||
|
})),
|
||||||
...docs.map((item) => ({
|
...docs.map((item) => ({
|
||||||
url: url(item.url),
|
url: url(item.url),
|
||||||
changeFrequency: 'monthly' as const,
|
changeFrequency: 'monthly' as const,
|
||||||
|
|||||||
Reference in New Issue
Block a user