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>
This commit is contained in:
@@ -1,31 +1,33 @@
|
||||
import type { Metadata } from "next";
|
||||
import { loadStatus } from "@/lib/site";
|
||||
|
||||
// Rendered per request from the backend's status; the published site is cached once it exists (§1).
|
||||
export const dynamic = "force-dynamic";
|
||||
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 status = await loadStatus();
|
||||
// Coming soon is a real page (HTTP 200) but never indexed (§5, decision 14).
|
||||
return status.mode === "coming-soon" ? { title: "Coming soon", robots: { index: false, follow: true } } : { title: "Home" };
|
||||
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 status = await loadStatus();
|
||||
if (status.mode === "coming-soon") {
|
||||
// The full Coming soon page (logo, service times, contact, links to Events) comes with the
|
||||
// church profile (§5).
|
||||
return (
|
||||
<main className="mx-auto flex min-h-screen max-w-xl flex-col items-center justify-center gap-4 px-4 text-center">
|
||||
<h1 className="text-3xl font-semibold text-brand">Coming soon</h1>
|
||||
<p className="text-gray-600">Our new website is on its way.</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
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 (
|
||||
<main className="mx-auto max-w-3xl px-4 py-16">
|
||||
<h1 className="text-3xl font-semibold">Welcome</h1>
|
||||
<p className="mt-2 text-gray-600">Published version {status.version}. The templates come next (§3).</p>
|
||||
</main>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user