import type { MetadataRoute } from "next"; import { absoluteUrl } from "@/lib/seo"; /** * /sitemap.xml — the public, indexable surface only. * * Authed routes, auth screens and unlisted /p/ share pages are * deliberately absent: they are `noindex` and disallowed in robots.ts, and a * sitemap that lists non-indexable URLs is a Search Console error. */ /** Legal pages change rarely; keep their stamp tied to the published revision. */ const LEGAL_UPDATED = new Date("2026-06-07T00:00:00.000Z"); type Entry = { path: string; priority: number; changeFrequency: MetadataRoute.Sitemap[number]["changeFrequency"]; lastModified: Date; }; const NOW = new Date(); const ROUTES: Entry[] = [ { path: "/", priority: 1.0, changeFrequency: "weekly", lastModified: NOW }, { path: "/features", priority: 0.9, changeFrequency: "monthly", lastModified: NOW }, { path: "/pricing", priority: 0.9, changeFrequency: "monthly", lastModified: NOW }, { path: "/faq", priority: 0.8, changeFrequency: "monthly", lastModified: NOW }, { path: "/about", priority: 0.6, changeFrequency: "yearly", lastModified: NOW }, { path: "/terms", priority: 0.3, changeFrequency: "yearly", lastModified: LEGAL_UPDATED }, { path: "/privacy", priority: 0.3, changeFrequency: "yearly", lastModified: LEGAL_UPDATED }, { path: "/cookies", priority: 0.3, changeFrequency: "yearly", lastModified: LEGAL_UPDATED }, { path: "/acceptable-use", priority: 0.3, changeFrequency: "yearly", lastModified: LEGAL_UPDATED }, { path: "/refunds", priority: 0.3, changeFrequency: "yearly", lastModified: LEGAL_UPDATED }, { path: "/subprocessors", priority: 0.3, changeFrequency: "yearly", lastModified: LEGAL_UPDATED }, ]; export default function sitemap(): MetadataRoute.Sitemap { return ROUTES.map(({ path, ...rest }) => ({ url: absoluteUrl(path), ...rest })); }