SPB Git

Repository Public

sitemap.ts 496 B 15 lines typescript

1import type { MetadataRoute } from "next";2import { nodes, site } from "@/lib/data";3import { LOCALES, ROUTES } from "@/lib/i18n";45export default function sitemap(): MetadataRoute.Sitemap {6  const paths = [...ROUTES, ...nodes.map((n) => `/nodes/${n.id}`)];7  return paths.flatMap((p) =>8    LOCALES.map((l) => ({9      url: `${site.url}/${l}${p}`,10      lastModified: site.updatedAt,11      alternates: { languages: { en: `${site.url}/en${p}`, "fr-CA": `${site.url}/fr${p}` } },12    })),13  );14}15
Files main
Menu

Theme