refactor: added features and restructuring

This commit is contained in:
Bart van der Braak 2023-06-15 01:39:07 +02:00
parent 652b69d837
commit 1592627eb4

View file

@ -1,79 +1,96 @@
import { Inter, Fjalla_One } from "next/font/google"; import { Inter as FontSans } from "next/font/google";
import localFont from "next/font/local";
import "@/styles/globals.css";
import { siteConfig } from "@/config/site";
import { absoluteUrl, cn } from "@/lib/utils";
import { Analytics } from "@/components/analytics";
import { TailwindIndicator } from "@/components/tailwind-indicator";
import { ThemeProvider } from "@/components/theme-provider"; import { ThemeProvider } from "@/components/theme-provider";
import "tailwindcss/tailwind.css";
import { Metadata } from "next"; export const metadata = {
export const metadata: Metadata = {
title: { title: {
default: "hellob.art", default: siteConfig.name,
template: "%s | hellob.art", template: `%s | ${siteConfig.name}`,
}, },
description: "a simple portfolio made by bart van der braak", description: siteConfig.description,
metadataBase: new URL("https://hellob.art"), keywords: [
openGraph: { "Next.js",
title: "hellob.art", "React",
description: "a simple portfolio made by bart van der braak", "Tailwind CSS",
url: "https://hellob.art", "Server Components",
siteName: "hellob.art", "Radix UI",
locale: "en-US", ],
type: "website", authors: [
}, {
robots: { name: "Bart van der Braak",
index: true, url: siteConfig.url,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
}, },
],
creator: "shadcn",
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "white" },
{ media: "(prefers-color-scheme: dark)", color: "black" },
],
openGraph: {
type: "website",
locale: "en_US",
url: siteConfig.url,
title: siteConfig.name,
description: siteConfig.description,
siteName: siteConfig.name,
}, },
twitter: { twitter: {
title: "hellob.art",
card: "summary_large_image", card: "summary_large_image",
title: siteConfig.name,
description: siteConfig.description,
images: [`${siteConfig.url}/og.jpg`],
creator: "@bartvdbraak",
}, },
icons: { icons: {
shortcut: "/favicon.png", icon: "/favicon.ico",
shortcut: "/favicon-16x16.png",
apple: "/apple-touch-icon.png",
}, },
manifest: `${siteConfig.url}/site.webmanifest`,
}; };
interface RootLayoutProps { interface RootLayoutProps {
children: React.ReactNode; children: React.ReactNode;
} }
const inter = Inter({ const fontSans = FontSans({
subsets: ["latin"], subsets: ["latin"],
variable: "--font-inter", variable: "--font-sans",
}); });
const fjallaOne = Fjalla_One({ // Font files can be colocated inside of `pages`
subsets: ["latin"], const fontHeading = localFont({
weight: "400", src: "../assets/fonts/CalSans-SemiBold.woff2",
variable: "--font-fjalla-one", variable: "--font-heading",
}); });
interface RootLayoutProps { interface RootLayoutProps {
children: React.ReactNode; children: React.ReactNode;
} }
export default async function RootLayout({ children }: RootLayoutProps) { export default function RootLayout({ children }: RootLayoutProps) {
return ( return (
<> <html lang="en" suppressHydrationWarning>
<html <head />
lang="en" <body
suppressHydrationWarning className={cn(
className={[inter.variable, fjallaOne.variable].join(" ")} "min-h-screen bg-background font-sans antialiased",
fontSans.variable,
fontHeading.variable
)}
> >
<head /> <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<body className="min-h-screen antialiased"> {children}
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem> <Analytics />
{children} <TailwindIndicator />
</ThemeProvider> </ThemeProvider>
</body> </body>
</html> </html>
</>
); );
} }