62eeee5f7c
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 1m1s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 53s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 2m4s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
Frontend - Dynamic-import Chart.js components on detail/compare views so Chart.js no longer ships in initial JS. - Drop force-dynamic on home, compare, rankings so internal data fetches reuse Next.js's per-call revalidate cache. - Switch /school/[slug] to ISR with a 7-day revalidate window (school data updates annually). - Preconnect to analytics + postcodes.io; remove redundant defer on the Umami Script tag (afterInteractive already covers it). - Bump images.minimumCacheTTL to 1 year. - Extract HowItWorks and Editorial sections as server components passed to HomeView via slot props so their JSX stays out of the client bundle. Backend - Add GZipMiddleware (min 512 bytes). - Add CacheAndETagMiddleware: per-path Cache-Control with long s-maxage + stale-while-revalidate, ETag generation, and 304 on If-None-Match. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
101 lines
3.1 KiB
TypeScript
101 lines
3.1 KiB
TypeScript
import type { Metadata, Viewport } from 'next';
|
|
import { DM_Sans, Playfair_Display } from 'next/font/google';
|
|
import Script from 'next/script';
|
|
import { Navigation } from '@/components/Navigation';
|
|
import { Footer } from '@/components/Footer';
|
|
import { ComparisonToast } from '@/components/ComparisonToast';
|
|
import { ComparisonProvider } from '@/context/ComparisonProvider';
|
|
import './globals.css';
|
|
|
|
const dmSans = DM_Sans({
|
|
subsets: ['latin'],
|
|
weight: ['400', '500', '600', '700'],
|
|
variable: '--font-dm-sans',
|
|
display: 'swap',
|
|
});
|
|
|
|
const playfairDisplay = Playfair_Display({
|
|
subsets: ['latin'],
|
|
weight: ['600', '700'],
|
|
variable: '--font-playfair',
|
|
display: 'swap',
|
|
});
|
|
|
|
export const viewport: Viewport = {
|
|
width: 'device-width',
|
|
initialScale: 1,
|
|
// viewport-fit=cover lets us paint behind the notch / Dynamic Island so
|
|
// env(safe-area-inset-*) values resolve to real numbers on iPhone.
|
|
viewportFit: 'cover',
|
|
themeColor: [
|
|
{ media: '(prefers-color-scheme: light)', color: '#faf7f2' },
|
|
{ media: '(prefers-color-scheme: dark)', color: '#1a1612' },
|
|
],
|
|
};
|
|
|
|
export const metadata: Metadata = {
|
|
appleWebApp: {
|
|
capable: true,
|
|
title: 'SchoolCompare',
|
|
statusBarStyle: 'default',
|
|
},
|
|
title: {
|
|
default: 'SchoolCompare | Compare School Performance',
|
|
template: '%s | SchoolCompare',
|
|
},
|
|
description: 'Compare primary and secondary school SATs and GCSE performance across England',
|
|
keywords: 'school comparison, KS2 results, KS4 results, primary school, secondary school, England schools, SATs results, GCSE results',
|
|
authors: [{ name: 'SchoolCompare' }],
|
|
manifest: '/manifest.json',
|
|
icons: {
|
|
icon: '/favicon.svg',
|
|
shortcut: '/favicon.svg',
|
|
apple: '/favicon.svg',
|
|
},
|
|
openGraph: {
|
|
type: 'website',
|
|
title: 'SchoolCompare | Compare School Performance',
|
|
description: 'Compare primary and secondary school SATs and GCSE performance across England',
|
|
url: 'https://schoolcompare.co.uk',
|
|
siteName: 'SchoolCompare',
|
|
},
|
|
twitter: {
|
|
card: 'summary',
|
|
title: 'SchoolCompare | Compare School Performance',
|
|
description: 'Compare primary and secondary school SATs and GCSE performance across England',
|
|
},
|
|
};
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
return (
|
|
<html lang="en">
|
|
<head>
|
|
<link rel="preconnect" href="https://analytics.schoolcompare.co.uk" />
|
|
<link rel="preconnect" href="https://api.postcodes.io" />
|
|
<Script
|
|
src="https://analytics.schoolcompare.co.uk/script.js"
|
|
data-website-id="d7fb0c95-bb6c-4336-8209-bd10077e50dd"
|
|
data-performance="true"
|
|
strategy="afterInteractive"
|
|
/>
|
|
</head>
|
|
<body className={`${dmSans.variable} ${playfairDisplay.variable}`}>
|
|
<div className="noise-overlay" />
|
|
<ComparisonProvider>
|
|
<a href="#main-content" className="skip-link">Skip to main content</a>
|
|
<Navigation />
|
|
<main id="main-content" className="main">
|
|
{children}
|
|
</main>
|
|
<ComparisonToast />
|
|
<Footer />
|
|
</ComparisonProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|