From 4fbaea9d9d36b591416116e1378c8798ff9fe613 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Mon, 4 May 2026 13:05:28 +0800 Subject: [PATCH] feat: add static sitemap entry allowlist (no auth pages) --- lib/sitemap/build-static-entries.ts | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lib/sitemap/build-static-entries.ts diff --git a/lib/sitemap/build-static-entries.ts b/lib/sitemap/build-static-entries.ts new file mode 100644 index 0000000..d0a95b5 --- /dev/null +++ b/lib/sitemap/build-static-entries.ts @@ -0,0 +1,50 @@ +import type { MetadataRoute } from "next" + +const BASE_URL = "https://deckyvault.xyz" + +/** + * Builds static sitemap entries for publicly-indexable pages. + * + * Auth pages (`/login`, `/signup`) are intentionally excluded because + * they provide no indexable content. Search engines should not surface + * authentication flows as standalone results. + * + * Also excluded: `/manage` (admin dashboard, noindex), `/search` + * (parameterized results, no canonical representation), `/profile` + * (user-specific), `/compare` (parameterized tool), and any `/api/*` + * routes (robots.txt disallow). + */ +export function buildStaticEntries(): MetadataRoute.Sitemap { + return [ + { + url: BASE_URL, + lastModified: new Date(), + changeFrequency: "weekly" as const, + priority: 1, + }, + { + url: `${BASE_URL}/games`, + lastModified: new Date(), + changeFrequency: "daily" as const, + priority: 0.8, + }, + { + url: `${BASE_URL}/devices`, + lastModified: new Date(), + changeFrequency: "monthly" as const, + priority: 0.6, + }, + { + url: `${BASE_URL}/updates`, + lastModified: new Date(), + changeFrequency: "weekly" as const, + priority: 0.5, + }, + { + url: `${BASE_URL}/contact`, + lastModified: new Date(), + changeFrequency: "yearly" as const, + priority: 0.3, + }, + ] +}