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:
@@ -2,16 +2,37 @@ import type { Metadata } from "next";
|
||||
import "@crosscode/ui/fonts.css";
|
||||
import "./globals.css";
|
||||
import { brandAttributes } from "@crosscode/ui";
|
||||
import { loadContent } from "@/site/load";
|
||||
|
||||
// The church's name, colours, fonts and corners come from its profile in Accounts once the Website
|
||||
// is linked (docs/WEBSITE-1.0-PLAN.md §2); until then, plain defaults.
|
||||
export const metadata: Metadata = {
|
||||
title: { default: "Church Website", template: "%s" },
|
||||
};
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const c = await loadContent();
|
||||
const name = c.church?.name ?? "Church Website";
|
||||
return { title: { default: name, template: `%s · ${name}` }, icons: c.church?.branding.iconUrl ? { icon: c.church.branding.iconUrl } : undefined };
|
||||
}
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
/**
|
||||
* Every page: the church's fonts and corners (shared brand style), the template and the style
|
||||
* settings as attributes (globals.css), and its colours, made safe by the backend, as variables.
|
||||
*/
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const c = await loadContent();
|
||||
const p = c.palette;
|
||||
const template = c.mode === "published" ? c.snapshot.design.template : c.template;
|
||||
const s = c.mode === "published" ? c.snapshot.design.style : null;
|
||||
const vars = `:root{--brand:${p.brand};--brand-dark:${p.brandDark};--on-brand:${p.onBrand};--brand-text:${p.brandText};--brand-tint:${p.brandTint};--accent:${p.accent};--on-accent:${p.onAccent}}`;
|
||||
return (
|
||||
<html lang="en-ZA" {...brandAttributes(null)}>
|
||||
<html
|
||||
lang="en-ZA"
|
||||
{...brandAttributes(c.style)}
|
||||
data-template={template}
|
||||
data-spacing={s?.spacing ?? "airy"}
|
||||
data-buttons={s?.buttons ?? "solid"}
|
||||
data-images={s?.images ?? "natural"}
|
||||
data-section-colour={s?.sectionColour ?? "light"}
|
||||
>
|
||||
<head>
|
||||
<style>{vars.replace(/[<>]/g, "")}</style>
|
||||
</head>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user