-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
236 lines (231 loc) Β· 7.72 KB
/
theme.config.tsx
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
import { useTheme } from "nextra-theme-docs";
import { useState, useEffect } from "react";
import { VercelLogo } from "./components/Icons";
import Image from "next/image";
import lightLogotype from "./public/images/logos/lightLogotype.png";
import darkLogotype from "./public/images/logos/darkLogotype.png";
import Link from "next/link";
import { useRouter } from "next/router";
import { useConfig } from "nextra-theme-docs";
import urlcat from "urlcat";
const useDark = () => {
const { resolvedTheme } = useTheme();
const [isDark, setIsDark] = useState(false);
useEffect(() => {
setIsDark(resolvedTheme === "dark");
return () => {
false;
};
}, [resolvedTheme]);
return isDark;
};
const config = {
primaryHue: 200, //550,
project: {
link: "https://github.com/periakteon",
},
chat: {
link: "https://twitter.com/frontendbeast_",
icon: (
<svg width="24" height="24" viewBox="0 0 248 204">
<path
fill="currentColor"
d="M221.95 51.29c.15 2.17.15 4.34.15 6.53 0 66.73-50.8 143.69-143.69 143.69v-.04c-27.44.04-54.31-7.82-77.41-22.64 3.99.48 8 .72 12.02.73 22.74.02 44.83-7.61 62.72-21.66-21.61-.41-40.56-14.5-47.18-35.07a50.338 50.338 0 0 0 22.8-.87C27.8 117.2 10.85 96.5 10.85 72.46v-.64a50.18 50.18 0 0 0 22.92 6.32C11.58 63.31 4.74 33.79 18.14 10.71a143.333 143.333 0 0 0 104.08 52.76 50.532 50.532 0 0 1 14.61-48.25c20.34-19.12 52.33-18.14 71.45 2.19 11.31-2.23 22.15-6.38 32.07-12.26a50.69 50.69 0 0 1-22.2 27.93c10.01-1.18 19.79-3.86 29-7.95a102.594 102.594 0 0 1-25.2 26.16z"
/>
</svg>
),
},
// docsRepositoryBase: "https://za.com/dahliaOS/documentation/blob/main/",
toc: {
extraContent: () => {
return (
<>
<Link target="_blank" href="https://twitter.com/frontendbeast_">
π¦ Follow on Twitter β
</Link>
<Link
target="_blank"
href="https://opencollective.com/frontend-beast"
>
π Support The FE Beast β
</Link>
</>
);
},
float: true,
},
feedback: {
content: null,
labels: "feedback",
},
navigation: { next: true, prev: true },
darkMode: true,
footer: {
text: () => {
return (
<>
<div
style={{ display: "flex", flexDirection: "column", gap: "10px" }}
>
<Link
href="https://vercel.com?utm_source=frontendBeast&utm_campaign=oss"
target="_blank"
style={{ display: "flex", flexDirection: "row", gap: "10px" }}
>
Powered By
<VercelLogo style={{ marginTop: "3px" }} />
</Link>
<p style={{ marginTop: "6px", fontSize: "12px" }}>
Β© {new Date().getFullYear()} The Front-End Beast
</p>
</div>
</>
);
},
},
editLink: {
text: null,
},
// gitTimestamp: true,
logo: () => {
const isDark = useDark();
return (
<>
<Image
src={isDark ? darkLogotype : lightLogotype}
width="120"
alt="The Front-End Beast"
style={{ marginRight: "10px", marginBottom: "3px" }}
/>
<span style={{ fontWeight: "600" }}>Docs</span>
</>
);
},
useNextSeoProps() {
const { route } = useRouter();
if (route !== "/") {
return {
titleTemplate: "%s β The Front-End Beast",
};
}
return { titleTemplate: "The Front-End Beast" };
},
// banner: {
// key: "2.0-release",
// text: (
// <a href="https://nextra.site" target="_blank" rel="noreferrer">
// π Nextra 2.0 is released. Read more β
// </a>
// ),
// },
head: () => {
const { asPath } = useRouter();
const { route } = useRouter();
const { title, ...meta } = useConfig().frontMatter;
return (
<>
<meta charSet="UTF-8" />
<meta name="yandex-verification" content="ce6ffa0fa2b08cf2" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<link rel="canonical" href="https://frontendbeast.com" />
<meta
property="og:url"
content={`https://frontendbeast.com${asPath}`}
/>
<meta name="theme-color" content="#0f67bf" />
<meta property="og:site_name" content="The Front-End Beast" />
<meta name="og:title" content="The Front-End Beast" />
<meta httpEquiv="Content-Language" content="en" />
<meta name="viewport" content="width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
rel="icon"
type="image/png"
href="/images/favicon/favicon-32x32.png"
/>
<meta name="apple-mobile-web-app-status-bar-style" content="#0f67bf" />
<meta name="apple-mobile-web-app-title" content="The Front-End Beast" />
<meta
name="msapplication-TileImage"
content="/images/favicon/favicon.png"
/>
<meta name="msapplication-TileColor" content="#0f67bf" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/images/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/images/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/images/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<meta
name="keywords"
content="HTML, CSS, JavaScript, Front-End Beast, Web development, Full Stack, Responsive design, HTML5, CSS3, Interactive projects, JavaScript frameworks, UI/UX, Progressive web apps, Next.js, Browser compatibility, Best practices, JavaScript libraries, SEO, Performance, Node.js, Tailwind CSS"
/>
<meta
property="description"
content={
meta.description ||
"Welcome to The Front-End Beast - your ultimate resource for mastering HTML basics, CSS styling, and JavaScript fundamentals. Dive into the world of front-end web development with our comprehensive tutorials, courses, and interactive projects."
}
/>
<meta
property="og:description"
content={
meta.description ||
"Welcome to The Front-End Beast - your ultimate resource for mastering HTML basics, CSS styling, and JavaScript fundamentals. Dive into the world of front-end web development with our comprehensive tutorials, courses, and interactive projects."
}
/>
<meta
property="og:image"
content={
meta.image ||
urlcat("https://frontendbeast.com/api/og/", {
title,
desc: meta.description ?? undefined,
})
}
/>
<meta
property="twitter:card"
content={meta.image ? "summary_large_image" : "summary"}
/>
<meta property="twitter:site" content="@frontendbeast_" />
{route === "/" ? (
<meta property="twitter:title" content="The Front-End Beast" />
) : (
<meta
property="twitter:title"
content={`${title} - The Front-End Beast`}
/>
)}
<meta property="twitter:description" content={meta.description} />
<meta
property="twitter:url"
content={`https://frontendbeast.com${asPath}`}
/>
<meta
property="twitter:image"
content={
meta.image ||
urlcat("https://frontendbeast.com/api/og/", {
title,
desc: meta.description ?? undefined,
})
}
/>
</>
);
},
};
export default config;