Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
176 lines
4.8 KiB
TypeScript
176 lines
4.8 KiB
TypeScript
import { Inter, Bricolage_Grotesque } from "next/font/google";
|
|
import type { Metadata, Viewport } from "next";
|
|
import type { ReactNode } from "react";
|
|
import { headers } from "next/headers";
|
|
import Script from "next/script";
|
|
import messages from "../messages/en/index";
|
|
import { ASSETS, getAssetPath } from "../lib/assetUtils";
|
|
import {
|
|
defaultShareImages,
|
|
originFromHost,
|
|
resolveRequestHost,
|
|
} from "../lib/siteMetadata";
|
|
import { umamiTracker } from "../lib/umami";
|
|
import "./globals.css";
|
|
|
|
// Session chrome (`ConditionalNavigation`) lives in `(marketing)`, `(app)`, and
|
|
// `(admin)` layouts, behind `<Suspense>`, so the static shell can prerender while
|
|
// the header streams with the request cookie.
|
|
//
|
|
// MessagesProvider + AuthModalProvider are mounted per route group (Phase 4b):
|
|
// `(marketing)` gets a trimmed slice without `create.*` (~41 KB gzipped saved
|
|
// per static page); `(app)`/`(admin)`/`(dev)` get the full tree. See
|
|
// `messages/en/marketing.ts` and `docs/perf/next16-eval.md`.
|
|
|
|
const inter = Inter({
|
|
subsets: ["latin"],
|
|
weight: ["400", "500", "600", "700"],
|
|
style: ["normal", "italic"],
|
|
variable: "--font-inter",
|
|
display: "swap",
|
|
preload: true,
|
|
fallback: ["system-ui", "arial"],
|
|
});
|
|
|
|
const bricolageGrotesque = Bricolage_Grotesque({
|
|
subsets: ["latin"],
|
|
weight: "variable",
|
|
axes: ["opsz"],
|
|
variable: "--font-bricolage-grotesque",
|
|
display: "swap",
|
|
preload: true,
|
|
fallback: ["system-ui", "arial"],
|
|
});
|
|
|
|
const homeMeta = messages.metadata.home;
|
|
|
|
/** Viewport and favicon use the Metadata / Viewport APIs; avoid a manual `<head>` with a second viewport `meta` (duplicates Next's head injection). */
|
|
export const viewport: Viewport = {
|
|
width: "device-width",
|
|
initialScale: 1,
|
|
};
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const headerStore = await headers();
|
|
const host = resolveRequestHost(
|
|
headerStore.get("x-forwarded-host"),
|
|
headerStore.get("host"),
|
|
);
|
|
|
|
return {
|
|
title: {
|
|
default: homeMeta.title,
|
|
template: messages.metadata.titleTemplate,
|
|
},
|
|
description: homeMeta.description,
|
|
keywords: [...homeMeta.keywords],
|
|
authors: [{ name: "Media Economies Design Lab" }],
|
|
creator: "Media Economies Design Lab",
|
|
publisher: "Media Economies Design Lab",
|
|
formatDetection: {
|
|
email: false,
|
|
address: false,
|
|
telephone: false,
|
|
},
|
|
metadataBase: new URL(originFromHost(host)),
|
|
icons: {
|
|
icon: [
|
|
{ url: getAssetPath(ASSETS.LOGO), type: "image/svg+xml" },
|
|
{ url: "/favicon.ico", sizes: "any" },
|
|
{
|
|
url: "/favicon-32x32.png",
|
|
sizes: "32x32",
|
|
type: "image/png",
|
|
},
|
|
{
|
|
url: "/favicon-16x16.png",
|
|
sizes: "16x16",
|
|
type: "image/png",
|
|
},
|
|
],
|
|
apple: [
|
|
{
|
|
url: "/apple-touch-icon.png",
|
|
sizes: "180x180",
|
|
type: "image/png",
|
|
},
|
|
],
|
|
},
|
|
openGraph: {
|
|
title: homeMeta.title,
|
|
description: homeMeta.description,
|
|
url: "/",
|
|
siteName: messages.metadata.siteName,
|
|
locale: "en_US",
|
|
type: "website",
|
|
images: defaultShareImages(),
|
|
},
|
|
twitter: {
|
|
card: "summary_large_image",
|
|
title: homeMeta.title,
|
|
description: homeMeta.description,
|
|
images: defaultShareImages().map((image) => image.url),
|
|
},
|
|
robots: {
|
|
index: true,
|
|
follow: true,
|
|
googleBot: {
|
|
index: true,
|
|
follow: true,
|
|
"max-video-preview": -1,
|
|
"max-image-preview": "large",
|
|
"max-snippet": -1,
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
const umami = umamiTracker();
|
|
|
|
return (
|
|
<html lang="en" className="font-sans">
|
|
<head>
|
|
<link
|
|
rel="preload"
|
|
as="image"
|
|
href={getAssetPath(ASSETS.AVATAR_1)}
|
|
type="image/png"
|
|
/>
|
|
<link
|
|
rel="preload"
|
|
as="image"
|
|
href={getAssetPath(ASSETS.AVATAR_2)}
|
|
type="image/png"
|
|
/>
|
|
<link
|
|
rel="preload"
|
|
as="image"
|
|
href={getAssetPath(ASSETS.AVATAR_3)}
|
|
type="image/png"
|
|
/>
|
|
</head>
|
|
{umami ? (
|
|
<body className={`${inter.variable} ${bricolageGrotesque.variable}`}>
|
|
<Script
|
|
src={umami.src}
|
|
strategy="afterInteractive"
|
|
data-website-id={umami.websiteId}
|
|
data-do-not-track="true"
|
|
data-exclude-search="true"
|
|
/>
|
|
<div className="mx-auto flex min-h-screen w-full max-w-[1920px] flex-col">
|
|
{children}
|
|
</div>
|
|
</body>
|
|
) : (
|
|
<body className={`${inter.variable} ${bricolageGrotesque.variable}`}>
|
|
<div className="mx-auto flex min-h-screen w-full max-w-[1920px] flex-col">
|
|
{children}
|
|
</div>
|
|
</body>
|
|
)}
|
|
</html>
|
|
);
|
|
}
|