Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,23 @@ const nextConfig: NextConfig = {
},
};

export default withPayload(nextConfig);
const payloadConfig = withPayload(nextConfig);
const payloadHeaders = payloadConfig.headers;

// Payload asks every page for the Sec-CH-Prefers-Color-Scheme hint, and Critical-CH makes
// Chrome repeat a first visit's document request. Only the admin reads the hint.
payloadConfig.headers = async () => {
const rules = (await payloadHeaders?.()) ?? [];
const isClientHintRule = (rule: (typeof rules)[number]) =>
rule.headers.some(({ key }) => key.toLowerCase() === "critical-ch");
if (!rules.some(isClientHintRule)) {
throw new Error(
"withPayload no longer sends Critical-CH: review the admin-only re-scope in next.config.ts",
);
}
return rules.map((rule) =>
isClientHintRule(rule) ? { ...rule, source: "/admin/:path*" } : rule,
);
};

export default payloadConfig;
1 change: 0 additions & 1 deletion src/app/(frontend)/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
--font-jost: var(--next-font-jost), sans-serif;
--font-blanch: var(--next-font-blanch);
--font-damion: var(--next-font-damion), cursive;
--font-goudy: var(--next-font-goudy);
}

@layer base {
Expand Down
7 changes: 0 additions & 7 deletions src/app/(frontend)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ const blanchCaps = localFont({
display: "swap",
});

const goudyStd = localFont({
src: "../../fonts/GoudyStd-Heavyface.woff2",
variable: "--next-font-goudy",
display: "swap",
});

export const metadata: Metadata = {
metadataBase: new URL("https://clarksbowlingclub.com"),
title: {
Expand Down Expand Up @@ -63,7 +57,6 @@ export default async function RootLayout({
${damion.variable}
${jost.variable}
${blanchCaps.variable}
${goudyStd.variable}

antialiased
`}
Expand Down
Loading