59 lines
2.0 KiB
TypeScript
59 lines
2.0 KiB
TypeScript
/**
|
||
* sitemap.ts — XML sitemap generation for Novarix Networks
|
||
*
|
||
* Next.js App Router generates /sitemap.xml automatically from the array
|
||
* returned by this default export.
|
||
*
|
||
* ─── Adding pages ────────────────────────────────────────────────────────
|
||
*
|
||
* Append an entry for each publicly reachable page:
|
||
*
|
||
* {
|
||
* url: "https://novarixnet.com/services",
|
||
* lastModified: new Date("2025-06-01"),
|
||
* changeFrequency: "monthly",
|
||
* priority: 0.8,
|
||
* },
|
||
*
|
||
* `lastModified` can be a Date object or an ISO 8601 string.
|
||
* `priority` is a hint (0.0–1.0) for search engine crawl budgeting.
|
||
*
|
||
* ─── Dynamic routes ──────────────────────────────────────────────────────
|
||
*
|
||
* For blog posts or product pages generated from a CMS, fetch slugs inside
|
||
* this function and map them to sitemap entries:
|
||
*
|
||
* const posts = await fetchPosts();
|
||
* return posts.map((p) => ({
|
||
* url: `https://novarixnet.com/blog/${p.slug}`,
|
||
* lastModified: p.updatedAt,
|
||
* changeFrequency: "weekly",
|
||
* priority: 0.6,
|
||
* }));
|
||
*
|
||
* ─── Output ──────────────────────────────────────────────────────────────
|
||
*
|
||
* <?xml version="1.0" encoding="UTF-8"?>
|
||
* <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
|
||
* <url>
|
||
* <loc>https://novarixnet.com</loc>
|
||
* <lastmod>…</lastmod>
|
||
* <changefreq>monthly</changefreq>
|
||
* <priority>1</priority>
|
||
* </url>
|
||
* </urlset>
|
||
*/
|
||
|
||
import type { MetadataRoute } from "next";
|
||
|
||
export default function sitemap(): MetadataRoute.Sitemap {
|
||
return [
|
||
{
|
||
url: "https://novarixnet.com",
|
||
lastModified: new Date(),
|
||
changeFrequency: "monthly",
|
||
priority: 1,
|
||
},
|
||
];
|
||
}
|