-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy paththeme.config.tsx
310 lines (292 loc) · 9.97 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
import { useRouter } from "next/router";
import { useConfig } from "nextra-theme-docs";
import { Link } from "nextra-theme-docs";
import { FaGithub, FaTwitter, FaLinkedin, FaRss } from "react-icons/fa";
import type { DocsThemeConfig } from "nextra-theme-docs";
import { DiCodeigniter } from "react-icons/di";
import { Poppins } from "next/font/google";
const logoFont = Poppins({
subsets: ["latin"],
weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
style: ["normal"],
});
const Logo = (
<div className="flex flex-row gap-2 justify-center items-center">
<DiCodeigniter className="text-green-600 text-xl" />
<span
className="text-xl pt-1.5 font-bold text-black dark:text-white hover:text-black/95 dark:hover:text-white/95 transition-all"
style={logoFont.style}
>
CS Resources
</span>
</div>
);
const Head = () => {
const { title } = useConfig();
const { route } = useRouter();
const pageTitle = route === "/" || !title ? "CS Hub" : `${title} | CS Hub`;
const socialImage = "";
return (
<>
<meta name="msapplication-TileColor" content="#fff" />
<meta name="theme-color" content="#fff" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta httpEquiv="Content-Language" content="en" />
{/* Icons */}
<link rel="icon" href="/favicon.jpg" type="image/png" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
{/* Description */}
<meta
name="description"
content="Empowering the next generation of computer scientists with cutting-edge articles, tutorials, and resources."
/>
<meta
name="og:description"
content="Empowering the next generation of computer scientists with cutting-edge articles, tutorials, and resources."
/>
{/* OpenGraph */}
<meta name="og:image" content={socialImage} />
<meta name="og:title" content={pageTitle} />
{/* Twitter */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={socialImage} />
<meta name="twitter:site:domain" content="http://localhost:3000" />
<meta name="twitter:url" content="http://localhost:3000" />
{/* Apple */}
<meta name="apple-mobile-web-app-title" content="cs-hub" />
</>
);
};
const currentYear = new Date().getFullYear();
const Footer = (
<footer className="text-gray-700 dark:text-gray-300 w-full">
<div className="mx-auto px-4 sm:px-6 lg:px-0 py-12">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
<div className="space-y-4">
<h2 className="text-2xl font-bold text-gray-900 dark:text-white">
CS Hub
</h2>
<p className="text-sm">
Empowering the next generation of computer scientists with
cutting-edge articles, tutorials, and resources.
</p>
<div className="flex space-x-4">
<a
href="https://github.com/programming-for-career/cs-resources"
target="_blank"
rel="noopener noreferrer"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
<FaGithub className="w-6 h-6" />
<span className="sr-only">GitHub</span>
</a>
<a
href="https://github.com/programming-for-career/cs-resources"
target="_blank"
rel="noopener noreferrer"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
<FaTwitter className="w-6 h-6" />
<span className="sr-only">Twitter</span>
</a>
<a
href="https://github.com/programming-for-career/cs-resources"
target="_blank"
rel="noopener noreferrer"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
<FaLinkedin className="w-6 h-6" />
<span className="sr-only">LinkedIn</span>
</a>
<a
href="https://github.com/programming-for-career/cs-resources"
target="_blank"
rel="noopener noreferrer"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
<FaRss className="w-6 h-6" />
<span className="sr-only">RSS Feed</span>
</a>
</div>
</div>
<div>
<h3 className="text-lg font-semibold mb-4 text-gray-900 dark:text-white">
Explore
</h3>
<ul className="space-y-2">
<li>
<Link
href="/articles"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
All Articles
</Link>
</li>
<li>
<Link
href="/topics"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Topics
</Link>
</li>
<li>
<Link
href="/tutorials"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Tutorials
</Link>
</li>
<li>
<Link
href="/resources"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Resources
</Link>
</li>
<li>
<Link
href="/events"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Events
</Link>
</li>
</ul>
</div>
<div>
<h3 className="text-lg font-semibold mb-4 text-gray-900 dark:text-white">
Popular Topics
</h3>
<ul className="space-y-2">
<li>
<Link
href="/topic/algorithms"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Algorithms
</Link>
</li>
<li>
<Link
href="/topic/data-structures"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Data Structures
</Link>
</li>
<li>
<Link
href="/topic/machine-learning"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Machine Learning
</Link>
</li>
<li>
<Link
href="/topic/web-development"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Web Development
</Link>
</li>
<li>
<Link
href="/topic/cybersecurity"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Cybersecurity
</Link>
</li>
</ul>
</div>
<div>
<h3 className="text-lg font-semibold mb-4 text-gray-900 dark:text-white">
Stay Updated
</h3>
<p className="mb-4 text-sm">
Subscribe to our newsletter for the latest articles and CS insights.
</p>
<form className="space-y-2">
<input
type="email"
placeholder="Enter your email"
className="w-full px-3 py-2 text-gray-900 bg-gray-200 dark:bg-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
required
/>
<button
type="submit"
className="w-full px-3 py-2 text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900"
>
Subscribe
</button>
</form>
</div>
</div>
<div className="mt-8 pt-8 border-t border-gray-300 dark:border-gray-800 flex flex-col sm:flex-row justify-between items-center">
<p className="text-sm">
© {new Date().getFullYear()} CS Resources Hub. All rights reserved.
</p>
<nav className="mt-4 sm:mt-0">
<ul className="flex space-x-4 text-sm">
<li>
<Link
href="/about"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
About
</Link>
</li>
<li>
<Link
href="/contact"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Contact
</Link>
</li>
<li>
<Link
href="/privacy"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Privacy Policy
</Link>
</li>
<li>
<Link
href="/terms"
className="hover:text-gray-900 dark:hover:text-white transition-colors"
>
Terms of Use
</Link>
</li>
</ul>
</nav>
</div>
</div>
</footer>
);
const config: DocsThemeConfig = {
logo: Logo,
head: Head,
footer: { text: Footer },
useNextSeoProps() {
const { asPath } = useRouter();
if (asPath !== "/") {
return {
titleTemplate: "%s | CS Resources",
};
}
},
sidebar: {
defaultMenuCollapseLevel: 1,
toggleButton: true,
},
toc: { backToTop: true },
};
export default config;