SPB Git

spb/cancerindex

Public
2.6 KB · 53 lines tsx
1import type { Metadata, Viewport } from 'next';2import { Newsreader, Inter, IBM_Plex_Mono } from 'next/font/google';3import './globals.css';4import { SiteHeader } from '@/components/layout/site-header';5import { SiteFooter } from '@/components/layout/site-footer';6import { SITE_URL, SITE_NAME, TAGLINE } from '@/lib/site';78const display = Newsreader({ variable: '--font-display', subsets: ['latin'], display: 'swap', weight: ['400', '500', '600'], style: ['normal', 'italic'] });9const ui = Inter({ variable: '--font-ui', subsets: ['latin'], display: 'swap' });10const code = IBM_Plex_Mono({ variable: '--font-code', subsets: ['latin'], display: 'swap', weight: ['400', '500'] });1112export const metadata: Metadata = {13  metadataBase: new URL(SITE_URL),14  title: { default: `${SITE_NAME} — ${TAGLINE}`, template: `%s · ${SITE_NAME}` },15  description: 'A provenance-first index of every recognized cancer entity: taxonomy, epidemiology, genomics, variants, therapies, clinical trials, literature and transparent rankings.',16  applicationName: SITE_NAME,17  robots: { index: true, follow: true },18  openGraph: { type: 'website', siteName: SITE_NAME, url: SITE_URL, title: `${SITE_NAME} — ${TAGLINE}`, description: 'Provenance-first oncology intelligence: every number linked to its source.' },19  twitter: { card: 'summary', title: SITE_NAME, description: TAGLINE },20};2122export const viewport: Viewport = {23  width: 'device-width',24  initialScale: 1,25  themeColor: [26    { media: '(prefers-color-scheme: light)', color: '#fafaf7' },27    { media: '(prefers-color-scheme: dark)', color: '#151514' },28  ],29};3031/** Applies the stored theme before first paint (no flash); "system" = no attribute. */32const THEME_BOOT = `try{var t=localStorage.getItem('ci-theme');if(t==='dark'||t==='light'){document.documentElement.setAttribute('data-theme',t)}}catch(e){}`;3334export default function RootLayout({ children }: { children: React.ReactNode }) {35  return (36    <html lang="en" className={`${display.variable} ${ui.variable} ${code.variable} h-full antialiased`} suppressHydrationWarning>37      <head>38        <script dangerouslySetInnerHTML={{ __html: THEME_BOOT }} />39      </head>40      <body className="flex min-h-full flex-col">41        <a href="#main" className="sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-[200] focus:border focus:border-accent focus:bg-paper focus:px-3 focus:py-2 focus:text-sm">42          Skip to content43        </a>44        <SiteHeader />45        <main id="main" className="mx-auto w-full max-w-[1400px] flex-1 px-4 sm:px-6">46          {children}47        </main>48        <SiteFooter />49      </body>50    </html>51  );52}53
Files · 18ad269a7d83e6da7230abddcf4e0d686cec73f3
Menu

Theme