Files
2026-05-20 18:29:19 -05:00

78 lines
1.9 KiB
TypeScript

import type { Metadata } from "next";
import { DM_Sans, Plus_Jakarta_Sans, Source_Serif_4 } from "next/font/google";
import "./globals.css";
import { brand, ebookMeta } from "@/content/ebook";
const dmSans = DM_Sans({
variable: "--font-dm-sans",
subsets: ["latin"],
weight: ["400", "500", "600", "700"],
});
const plusJakarta = Plus_Jakarta_Sans({
variable: "--font-plus-jakarta",
subsets: ["latin"],
weight: ["500", "600", "700", "800"],
});
const sourceSerif = Source_Serif_4({
variable: "--font-source-serif",
subsets: ["latin"],
weight: ["400", "500", "600"],
});
export const metadata: Metadata = {
title: `${ebookMeta.title} — Free Digital Nomad Ebook`,
description: ebookMeta.subtitle,
keywords: [
"digital nomad",
"remote work",
"work from anywhere",
"nomad visa",
"location independent",
],
openGraph: {
title: `${ebookMeta.title} — Digital Nomad Guide`,
description: ebookMeta.subtitle,
type: "website",
locale: "en_US",
},
};
const themeScript = `
(function () {
try {
var stored = localStorage.getItem('theme');
var dark =
stored === 'dark' ||
(stored !== 'light' &&
window.matchMedia('(prefers-color-scheme: dark)').matches);
document.documentElement.classList.toggle('dark', dark);
} catch (e) {}
})();
`;
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html
lang="en"
suppressHydrationWarning
className={`${dmSans.variable} ${plusJakarta.variable} ${sourceSerif.variable} h-full scroll-smooth antialiased`}
>
<head>
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
</head>
<body className="min-h-full font-sans">
<div className="mesh-bg" aria-hidden>
<div className="mesh-orb mesh-orb--sky" />
</div>
{children}
</body>
</html>
);
}