2023-07-16 18:52:51 +08:00
|
|
|
import 'css/tailwind.css'
|
|
|
|
import 'pliny/search/algolia.css'
|
2024-06-02 22:05:25 +08:00
|
|
|
import 'remark-github-blockquote-alert/alert.css'
|
2023-07-07 11:17:22 +08:00
|
|
|
|
2023-07-29 19:00:04 +08:00
|
|
|
import { Space_Grotesk } from 'next/font/google'
|
2023-07-16 18:52:51 +08:00
|
|
|
import { Analytics, AnalyticsConfig } from 'pliny/analytics'
|
|
|
|
import { SearchProvider, SearchConfig } from 'pliny/search'
|
2023-07-07 11:17:22 +08:00
|
|
|
import Header from '@/components/Header'
|
|
|
|
import SectionContainer from '@/components/SectionContainer'
|
|
|
|
import Footer from '@/components/Footer'
|
|
|
|
import siteMetadata from '@/data/siteMetadata'
|
|
|
|
import { ThemeProviders } from './theme-providers'
|
2023-07-08 21:03:46 +08:00
|
|
|
import { Metadata } from 'next'
|
2023-07-07 11:17:22 +08:00
|
|
|
|
2023-07-29 19:00:04 +08:00
|
|
|
const space_grotesk = Space_Grotesk({
|
2023-07-07 11:17:22 +08:00
|
|
|
subsets: ['latin'],
|
2023-07-29 11:06:46 +08:00
|
|
|
display: 'swap',
|
2023-07-29 19:00:04 +08:00
|
|
|
variable: '--font-space-grotesk',
|
2023-07-07 11:17:22 +08:00
|
|
|
})
|
|
|
|
|
2023-07-08 21:03:46 +08:00
|
|
|
export const metadata: Metadata = {
|
|
|
|
metadataBase: new URL(siteMetadata.siteUrl),
|
|
|
|
title: {
|
|
|
|
default: siteMetadata.title,
|
|
|
|
template: `%s | ${siteMetadata.title}`,
|
|
|
|
},
|
|
|
|
description: siteMetadata.description,
|
|
|
|
openGraph: {
|
|
|
|
title: siteMetadata.title,
|
|
|
|
description: siteMetadata.description,
|
|
|
|
url: './',
|
|
|
|
siteName: siteMetadata.title,
|
|
|
|
images: [siteMetadata.socialBanner],
|
|
|
|
locale: 'en_US',
|
|
|
|
type: 'website',
|
|
|
|
},
|
|
|
|
alternates: {
|
|
|
|
canonical: './',
|
2023-07-09 23:29:39 +08:00
|
|
|
types: {
|
|
|
|
'application/rss+xml': `${siteMetadata.siteUrl}/feed.xml`,
|
|
|
|
},
|
2023-07-08 21:03:46 +08:00
|
|
|
},
|
|
|
|
robots: {
|
|
|
|
index: true,
|
|
|
|
follow: true,
|
|
|
|
googleBot: {
|
|
|
|
index: true,
|
|
|
|
follow: true,
|
|
|
|
'max-video-preview': -1,
|
|
|
|
'max-image-preview': 'large',
|
|
|
|
'max-snippet': -1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
twitter: {
|
|
|
|
title: siteMetadata.title,
|
|
|
|
card: 'summary_large_image',
|
|
|
|
images: [siteMetadata.socialBanner],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-07-07 11:17:22 +08:00
|
|
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
2024-07-14 18:03:58 +02:00
|
|
|
const basePath = process.env.BASE_PATH || ''
|
|
|
|
|
2023-07-07 11:17:22 +08:00
|
|
|
return (
|
2023-07-22 16:01:25 +08:00
|
|
|
<html
|
|
|
|
lang={siteMetadata.language}
|
2023-07-29 19:00:04 +08:00
|
|
|
className={`${space_grotesk.variable} scroll-smooth`}
|
2023-07-22 16:01:25 +08:00
|
|
|
suppressHydrationWarning
|
|
|
|
>
|
2024-07-14 18:03:58 +02:00
|
|
|
<link
|
|
|
|
rel="apple-touch-icon"
|
|
|
|
sizes="76x76"
|
|
|
|
href={`${basePath}/static/favicons/apple-touch-icon.png`}
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel="icon"
|
|
|
|
type="image/png"
|
|
|
|
sizes="32x32"
|
|
|
|
href={`${basePath}/static/favicons/favicon-32x32.png`}
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel="icon"
|
|
|
|
type="image/png"
|
|
|
|
sizes="16x16"
|
|
|
|
href={`${basePath}/static/favicons/favicon-16x16.png`}
|
|
|
|
/>
|
|
|
|
<link rel="manifest" href={`${basePath}/static/favicons/site.webmanifest`} />
|
|
|
|
<link
|
|
|
|
rel="mask-icon"
|
|
|
|
href={`${basePath}/static/favicons/safari-pinned-tab.svg`}
|
|
|
|
color="#5bbad5"
|
|
|
|
/>
|
2023-07-08 21:03:46 +08:00
|
|
|
<meta name="msapplication-TileColor" content="#000000" />
|
|
|
|
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fff" />
|
|
|
|
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000" />
|
2024-07-14 18:03:58 +02:00
|
|
|
<link rel="alternate" type="application/rss+xml" href={`${basePath}/feed.xml`} />
|
2024-02-13 15:22:33 +09:00
|
|
|
<body className="bg-white pl-[calc(100vw-100%)] text-black antialiased dark:bg-gray-950 dark:text-white">
|
2023-07-07 11:17:22 +08:00
|
|
|
<ThemeProviders>
|
2023-07-16 18:52:51 +08:00
|
|
|
<Analytics analyticsConfig={siteMetadata.analytics as AnalyticsConfig} />
|
2023-07-07 11:17:22 +08:00
|
|
|
<SectionContainer>
|
2024-07-25 01:52:13 -04:00
|
|
|
<SearchProvider searchConfig={siteMetadata.search as SearchConfig}>
|
|
|
|
<Header />
|
|
|
|
<main className="mb-auto">{children}</main>
|
|
|
|
</SearchProvider>
|
|
|
|
<Footer />
|
2023-07-07 11:17:22 +08:00
|
|
|
</SectionContainer>
|
|
|
|
</ThemeProviders>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
)
|
|
|
|
}
|