Files
crosscode-platform/apps/website/frontend/src/app/page.tsx
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

34 lines
1.4 KiB
TypeScript

import type { Metadata } from "next";
import { cookies } from "next/headers";
import { ComingSoon } from "@/site/ComingSoon";
import { loadContent } from "@/site/load";
import { churchLd, pageMetadata } from "@/site/meta";
import { Sections } from "@/site/sections";
import { Shell } from "@/site/Shell";
export async function generateMetadata(): Promise<Metadata> {
const c = await loadContent();
if (c.mode === "coming-soon") {
// A real page (HTTP 200) that's never indexed (§5, decision 14).
return { title: { absolute: c.church ? `${c.church.name}: coming soon` : "Coming soon" }, robots: { index: false, follow: true } };
}
const home = c.snapshot.pages.find((p) => p.kind === "home");
return home ? pageMetadata(c, home) : {};
}
export default async function Home() {
const c = await loadContent();
if (c.mode === "coming-soon") return <ComingSoon c={c} signedInAdmin={(await cookies()).has("ccw_session")} />;
const home = c.snapshot.pages.find((p) => p.kind === "home");
const sections = home?.sections ?? [];
const ld = churchLd(c, "/");
return (
<Shell site={c} path="/">
{ld && <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: ld }} />}
{/* Exactly one <h1> (§11): the hero's, else the church's name. */}
{sections[0]?.type !== "hero" && <h1 className="sr-only">{c.church?.name ?? "Home"}</h1>}
<Sections site={c} sections={sections} />
</Shell>
);
}