1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 03:25:23 -04:00
jarv.is/app/layout.tsx
2025-04-24 11:20:02 -04:00

88 lines
2.9 KiB
TypeScript

import { env } from "../lib/env";
import { JsonLd } from "react-schemaorg";
import { Analytics } from "@vercel/analytics/next";
import { ThemeProvider, ThemeScript } from "../contexts/ThemeContext";
import Header from "../components/Header";
import Footer from "../components/Footer";
import { SkipNavLink, SkipNavTarget } from "../components/SkipNav";
import cn from "../lib/helpers/classnames";
import { defaultMetadata } from "../lib/helpers/metadata";
import * as config from "../lib/config";
import type { Person, WebSite } from "schema-dts";
import { GeistMono, GeistSans } from "./fonts";
import "./globals.css";
export const metadata = defaultMetadata;
const RootLayout = ({ children }: Readonly<{ children: React.ReactNode }>) => {
return (
<html
lang={env.NEXT_PUBLIC_SITE_LOCALE}
className={cn(GeistSans.variable, GeistMono.variable)}
suppressHydrationWarning
>
<head>
<ThemeScript />
<JsonLd<Person>
item={{
"@context": "https://schema.org",
"@type": "Person",
"@id": `${env.NEXT_PUBLIC_BASE_URL}/#person`,
name: config.authorName,
url: env.NEXT_PUBLIC_BASE_URL,
image: [`${env.NEXT_PUBLIC_BASE_URL}/opengraph-image.jpg`],
sameAs: [
env.NEXT_PUBLIC_BASE_URL,
`https://${config.authorSocial?.mastodon}`,
`https://github.com/${config.authorSocial?.github}`,
`https://bsky.app/profile/${config.authorSocial?.bluesky}`,
`https://twitter.com/${config.authorSocial?.twitter}`,
`https://medium.com/@${config.authorSocial?.medium}`,
`https://www.linkedin.com/in/${config.authorSocial?.linkedin}/`,
`https://www.facebook.com/${config.authorSocial?.facebook}`,
`https://www.instagram.com/${config.authorSocial?.instagram}/`,
],
}}
/>
<JsonLd<WebSite>
item={{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": `${env.NEXT_PUBLIC_BASE_URL}/#website`,
name: config.siteName,
url: env.NEXT_PUBLIC_BASE_URL,
author: config.authorName,
description: config.description,
inLanguage: env.NEXT_PUBLIC_SITE_LOCALE,
license: config.licenseUrl,
}}
/>
</head>
<body className="bg-background-outer font-sans text-gray-900">
<ThemeProvider>
<SkipNavLink />
<div className="mx-auto flex min-h-screen flex-col">
<Header />
<main className="bg-background-inner w-full text-sm">
<SkipNavTarget />
<div className="max-w-default mx-auto p-5">{children}</div>
</main>
<Footer />
</div>
</ThemeProvider>
<Analytics />
</body>
</html>
);
};
export default RootLayout;