Church details saved through Accounts' church.update (live at once). Settings: Search Console and Bing codes, Coming soon line, menu order. Audit log and recent edits. A made share image, Event / VideoObject / PodcastEpisode / BreadcrumbList structured data, permanent redirects from old page addresses. Saves refused when someone else saved in between; Ministry leaders' events; templates previewed with the church's own content before choosing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
904 B
TypeScript
20 lines
904 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.slug).map((e) => ({ url: at(`/events/${e.slug}`), changeFrequency: "weekly" as const, priority: 0.5 })),
|
|
];
|
|
}
|