25 lines
853 B
TypeScript
25 lines
853 B
TypeScript
// app/sitemap.ts
|
|
import type { MetadataRoute } from "next";
|
|
import { site } from "@/lib/site";
|
|
import { getAllServices } from "@/lib/services";
|
|
|
|
// If you already include other routes, merge them below.
|
|
export default function sitemap(): MetadataRoute.Sitemap {
|
|
const now = new Date().toISOString();
|
|
|
|
const base: MetadataRoute.Sitemap = [
|
|
{ url: `${site.url}/`, lastModified: now, changeFrequency: "weekly", priority: 1 },
|
|
{ url: `${site.url}/services`, lastModified: now, changeFrequency: "weekly", priority: 0.8 },
|
|
{ url: `${site.url}/contact`, lastModified: now, changeFrequency: "monthly", priority: 0.6 },
|
|
];
|
|
|
|
const services = getAllServices().map((s) => ({
|
|
url: `${site.url}/services/${s.slug}`,
|
|
lastModified: now,
|
|
changeFrequency: "monthly" as const,
|
|
priority: 0.7,
|
|
}));
|
|
|
|
return [...base, ...services];
|
|
}
|