Files
crosscode-platform/apps/website/frontend/src/app/sitemap.ts
T
joshuaandClaude Opus 5.5 5ed7201efa feat(website): the four templates and the public site
Heritage, Bold, Community and Clean drawing all 26 section variants
with their headers, homepage order and style settings; colours made
safe (WCAG AA) by the backend; fonts and corners from the shared brand
style. Publishing into numbered versions, the content API with live
messages and events and the church profile from Accounts, uploads,
every page kind, simple event pages, Coming soon, 404, sitemap, SEO
basics and the church's JSON-LD. The demo church (npm run demo) and
Playwright e2e: every template's pages pass axe and the SEO checks.
website.sh builds packages/seo. Decision 17 (first Owner) recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:59:03 +02:00

20 lines
905 B
TypeScript

import type { MetadataRoute } from "next";
import { loadContent } from "@/site/load";
import { siteBase } from "@/site/meta";
/**
* The published pages and the Website's own events (ROADMAP-v3 §11). Events copied from Cross
* Events aren't listed: their canonical page is at the origin. Before the first publish: empty.
*/
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const c = await loadContent();
if (c.mode !== "published") return [];
const base = siteBase(c);
if (!base) return [];
const at = (path: string) => new URL(path, base).toString();
return [
...c.snapshot.pages.map((p) => ({ url: at(p.path), changeFrequency: "weekly" as const, priority: p.kind === "home" ? 1 : 0.7 })),
...c.events.filter((e) => e.from === "website" && e.url.startsWith("/")).map((e) => ({ url: at(e.url), changeFrequency: "weekly" as const, priority: 0.5 })),
];
}