diff options
| author | Bertrand Yuan <bert.yuan@outlook.com> | 2025-12-16 00:12:49 +0800 |
|---|---|---|
| committer | Bertrand Yuan <bert.yuan@outlook.com> | 2025-12-16 00:12:49 +0800 |
| commit | 02ae938c238c9d18448d17a8ec92c0edd8c17463 (patch) | |
| tree | dcd6a30505adb52522b20af2c0ac27f713403f10 /src/app/(main)/layout.tsx | |
| parent | 48b07bc308a35734a6a7a305c8fdccbfa47de7d8 (diff) | |
feat(back-end): introduce payload
Payload is the next.js Headless CMS and App Framework,
I would like to pick it up and modify it as it is MIT licensed.
Many features in Payload is not applicable for our project.
So, I modify it so that it is light and clear.
Diffstat (limited to 'src/app/(main)/layout.tsx')
| -rw-r--r-- | src/app/(main)/layout.tsx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx new file mode 100644 index 0000000..c9e7dee --- /dev/null +++ b/src/app/(main)/layout.tsx @@ -0,0 +1,52 @@ +import { createMetadata } from '@/lib/metadata'; +import type { Viewport } from 'next'; +import { Geist, Geist_Mono } from 'next/font/google'; +import type { ReactNode } from 'react'; +import '@/styles/globals.css'; +import 'katex/dist/katex.css'; +import { baseUrl } from '@/lib/constants'; +import { Body } from '@/app/(main)/layout.client'; +import { description as homeDescription } from '@/app/(main)/layout.config'; +import { Provider } from '@/app/(main)/provider'; + +const geistSans = Geist({ + variable: '--font-geist-sans', + subsets: ['latin'], +}); + +const geistMono = Geist_Mono({ + variable: '--font-geist-mono', + subsets: ['latin'], +}); + +export const metadata = createMetadata({ + title: { + template: '%s | Blog', + default: 'Blog', + }, + description: homeDescription, + metadataBase: baseUrl, +}); + +export const viewport: Viewport = { + themeColor: [ + { media: '(prefers-color-scheme: dark)', color: '#0A0A0A' }, + { media: '(prefers-color-scheme: light)', color: '#fff' }, + ], +}; + +const RootLayout = ({ children }: { children: ReactNode }) => { + return ( + <html + lang='en' + className={`${geistSans.variable} ${geistMono.variable} antialiased`} + suppressHydrationWarning + > + <Body> + <Provider>{children}</Provider> + </Body> + </html> + ); +}; + +export default RootLayout; |
