import type { MetadataRoute } from "next"; import { ROUTES, SITE_URL } from "./lib/site"; export const dynamic = "force-static"; export default function sitemap(): MetadataRoute.Sitemap { const lastModified = new Date(); return ROUTES.map((route) => { // `trailingSlash: true` : l'URL canonique se termine par `/` sauf la racine. const path = route.path === "/" ? "/" : `${route.path}/`; return { url: new URL(path, SITE_URL).toString(), lastModified, changeFrequency: route.path === "/" ? "monthly" : "yearly", priority: route.priority, }; }); }