-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.tsx
More file actions
140 lines (136 loc) · 3.44 KB
/
layout.tsx
File metadata and controls
140 lines (136 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import type { Metadata } from 'next';
import localFont from 'next/font/local';
import './globals.css';
import React from 'react';
import Footer from '@/app/entities/common/Footer';
import NavBar from '@/app/entities/common/NavBar';
import ToastProvider from '@/app/entities/common/Toast/ToastProvider';
import { GoogleAnalytics } from '@next/third-parties/google';
export const metadata: Metadata = {
title: 'ShipFriend TechBlog',
description: '문제 해결 경험과 개발 지식을 공유하는 개발 블로그입니다.',
icons: {
icon: '/favicon.ico',
},
keywords: [
'ShipFriend',
'TechBlog',
'개발 블로그',
'프론트엔드 개발',
'웹 개발',
'JavaScript',
'React',
'Next.js',
'TypeScript',
],
openGraph: {
title: 'ShipFriend TechBlog',
description: '문제 해결 경험과 개발 지식을 공유하는 개발 블로그입니다.',
url: process.env.NEXT_PUBLIC_DEPLOYMENT_URL || 'https://www.shipfriend.dev',
siteName: 'ShipFriend TechBlog',
images: [
{
url: '/images/profile/profile.jpg',
width: 512,
height: 512,
alt: 'ShipFriend TechBlog Open Graph Image',
},
],
locale: 'ko_KR',
type: 'website',
},
other: {
'application-name': 'Shipfriend Tech Blog',
author: 'ShipFriend',
'og:type': 'article',
'article:tag': 'technology,programming,web development',
},
};
const pretendard = localFont({
src: [
{
path: './fonts/woff2/Pretendard-Thin.woff2',
weight: '100',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-ExtraLight.woff2',
weight: '200',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-Light.woff2',
weight: '300',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-Regular.woff2',
weight: '400',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-Medium.woff2',
weight: '500',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-SemiBold.woff2',
weight: '600',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-Bold.woff2',
weight: '700',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-ExtraBold.woff2',
weight: '800',
style: 'normal',
},
{
path: './fonts/woff2/Pretendard-Black.woff2',
weight: '900',
style: 'normal',
},
],
variable: '--font-pretendard',
});
const preventFOUC = `
(function() {
const savedTheme = JSON.parse(localStorage.getItem('theme-storage')).state.theme || 'light';
const isDark = savedTheme === 'dark';
if (isDark) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
document.documentElement.style.backgroundColor = isDark ? '#1e201e' : '#ffffff';
})();
`;
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="ko">
<head>
<script
dangerouslySetInnerHTML={{
__html: preventFOUC,
}}
/>
</head>
<body
className={`${pretendard.variable} font-sans antialiased min-h-screen flex flex-col justify-between`}
>
<NavBar />
<main className="flex-grow pb-20">{children}</main>
<Footer />
<ToastProvider />
<GoogleAnalytics gaId={'G-8HJPFDHXEC'} />
</body>
</html>
);
}