Become a Pro / website · becomeapro.ai / src / app / layout.tsx
| 1 | import type { Metadata, Viewport } from "next"; |
| 2 | import Script from "next/script"; |
| 3 | import { Funnel_Display, Geist, Geist_Mono, Poppins } from "next/font/google"; |
| 4 | import "./globals.css"; |
| 5 | import { cn } from "@/lib/utils"; |
| 6 | import { SiteHeader } from "@/components/site-header"; |
| 7 | import { SiteFooter } from "@/components/site-footer"; |
| 8 | import { ThemeProvider } from "@/components/theme/theme-provider"; |
| 9 | import { AUTHOR, RSS_ALTERNATE, SITE_DESCRIPTION, SITE_NAME, SITE_OG_IMAGE, SITE_OG_IMAGE_ALT, SITE_TITLE, SITE_URL } from "@/lib/seo"; |
| 10 | |
| 11 | const display = Funnel_Display({ subsets: ["latin"], display: "swap", variable: "--font-display" }); |
| 12 | const sans = Geist({ subsets: ["latin"], display: "swap", variable: "--font-sans" }); |
| 13 | const mono = Geist_Mono({ subsets: ["latin"], display: "swap", variable: "--font-mono" }); |
| 14 | // The wordmark is set in Poppins SemiBold, as on the original site |
| 15 | const mark = Poppins({ subsets: ["latin"], weight: "600", display: "swap", variable: "--font-mark" }); |
| 16 | |
| 17 | // Defaults for every page; each page sets its own canonical URL, title and share card with pageMetadata() |
| 18 | export const metadata: Metadata = { |
| 19 | title: { default: SITE_TITLE, template: `%s | ${SITE_NAME}` }, |
| 20 | description: SITE_DESCRIPTION, |
| 21 | metadataBase: new URL(SITE_URL), |
| 22 | applicationName: SITE_NAME, |
| 23 | icons: { |
| 24 | // app/favicon.ico is added automatically; this is the sharper icon for high-density screens |
| 25 | icon: [{ url: "/android-chrome-192x192.png", sizes: "192x192", type: "image/png" }], |
| 26 | apple: "/apple-touch-icon.png", |
| 27 | }, |
| 28 | authors: [{ name: AUTHOR.name, url: AUTHOR.path }], |
| 29 | creator: AUTHOR.name, |
| 30 | publisher: "AI Resource Pro", |
| 31 | category: "technology", |
| 32 | keywords: ["AI tutorials", "Claude Code", "Codex", "ChatGPT", "computer use", "AI agents", "open-weight models", "Runpod", "ComfyUI"], |
| 33 | manifest: "/site.webmanifest", |
| 34 | alternates: { types: RSS_ALTERNATE }, |
| 35 | // Google Search Console ownership of https://airesourcepro.com/ (keep it, or the property loses verification) |
| 36 | verification: { google: "dR3ow4mE5vjoNgGzd9u4tRYa5xvWFDHOTYwIaZIeOwU" }, |
| 37 | openGraph: { |
| 38 | title: SITE_TITLE, |
| 39 | description: SITE_DESCRIPTION, |
| 40 | siteName: SITE_NAME, |
| 41 | locale: "en_US", |
| 42 | type: "website", |
| 43 | images: [{ url: SITE_OG_IMAGE, width: 1200, height: 630, alt: SITE_OG_IMAGE_ALT }], |
| 44 | }, |
| 45 | twitter: { |
| 46 | card: "summary_large_image", |
| 47 | title: SITE_TITLE, |
| 48 | description: SITE_DESCRIPTION, |
| 49 | images: [{ url: SITE_OG_IMAGE, width: 1200, height: 630, alt: SITE_OG_IMAGE_ALT }], |
| 50 | }, |
| 51 | }; |
| 52 | |
| 53 | export const viewport: Viewport = { |
| 54 | themeColor: [ |
| 55 | { media: "(prefers-color-scheme: dark)", color: "#111111" }, |
| 56 | { media: "(prefers-color-scheme: light)", color: "#f7f7f7" }, |
| 57 | ], |
| 58 | colorScheme: "dark light", |
| 59 | }; |
| 60 | |
| 61 | export default function RootLayout({ children }: { children: React.ReactNode }) { |
| 62 | return ( |
| 63 | <html |
| 64 | lang="en" |
| 65 | suppressHydrationWarning |
| 66 | className={cn(display.variable, sans.variable, mono.variable, mark.variable)} |
| 67 | > |
| 68 | <head> |
| 69 | <link rel="stylesheet" href="/assets/visitor-odometer.v1.css" /> |
| 70 | {/* No orphans: no single word alone on a last line (shared fix, hosting-research assets/no-orphans). */} |
| 71 | <link rel="stylesheet" href="/no-orphans.css" /> |
| 72 | <script src="/no-orphans.js" defer /> |
| 73 | </head> |
| 74 | <body className="min-h-screen overflow-x-hidden bg-background font-sans text-foreground antialiased"> |
| 75 | <ThemeProvider> |
| 76 | <div className="flex min-h-screen flex-col"> |
| 77 | <SiteHeader /> |
| 78 | <main className="flex-1">{children}</main> |
| 79 | <SiteFooter /> |
| 80 | </div> |
| 81 | </ThemeProvider> |
| 82 | {/* Share buttons (components/share-button.tsx) */} |
| 83 | <Script src="/share.js" strategy="afterInteractive" /> |
| 84 | <Script src="/assets/visitor-odometer.v1.js" strategy="afterInteractive" /> |
| 85 | </body> |
| 86 | </html> |
| 87 | ); |
| 88 | } |