-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
258 lines (244 loc) · 8.12 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
258 lines (244 loc) · 8.12 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
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
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const {version: pkgVersion} = require('./package.json');
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
const config: Config = {
title: 'Python & Data Analysis Course',
tagline: 'Learn Python and data analysis in your browser — no installs needed',
favicon: 'img/favicon.ico',
future: {
v4: true,
},
url: 'https://pyda-course.online',
baseUrl: '/',
organizationName: 'abderrahim-lectures',
projectName: 'python-data-analysis-course',
headTags: [
{
tagName: 'meta',
attributes: {name: 'author', content: 'Abderrahim Adrabi'},
},
{
tagName: 'script',
attributes: {type: 'application/ld+json'},
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Course',
name: 'Python & Data Analysis Course',
description:
'A free, browser-based Python and data analysis course covering Python fundamentals and pandas/EDA across two 5-week sections, each with Normal and Hard tracks.',
author: {
'@type': 'Person',
name: 'Abderrahim Adrabi',
},
provider: {
'@type': 'Organization',
name: 'Python & Data Analysis Course',
sameAs: 'https://github.com/abderrahim-lectures/python-data-analysis-course',
},
isAccessibleForFree: true,
inLanguage: ['en', 'ar', 'es', 'fr'],
}),
},
],
trailingSlash: false,
onBrokenLinks: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
i18n: {
defaultLocale: 'en',
locales: ['en', 'ar', 'es', 'fr'],
localeConfigs: {
en: {label: 'English', direction: 'ltr'},
ar: {label: 'العربية', direction: 'rtl'},
es: {label: 'Español', direction: 'ltr'},
fr: {label: 'Français', direction: 'ltr'},
},
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
editUrl:
'https://github.com/abderrahim-lectures/python-data-analysis-course/tree/main/',
remarkPlugins: [require('remark-math')],
rehypePlugins: [require('rehype-katex')],
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
sitemap: {
// /share renders per-student, query-string-driven content with no
// canonical SEO value of its own — keep it out of the sitemap
// (it's also disallowed in static/robots.txt and marked noindex).
ignorePatterns: ['/share'],
changefreq: 'weekly',
priority: 0.5,
},
gtag: {
trackingID: 'G-FTR585C5BX',
anonymizeIP: true,
},
} satisfies Preset.Options,
],
],
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV',
crossorigin: 'anonymous',
},
],
themes: ['@easyops-cn/docusaurus-search-local'],
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
// The Capstone Projects feature was renamed/reorganized into an
// open, ongoing "Real-World Projects" library — these keep old
// shared links, search results, and README references working.
redirects: [
{to: '/docs/projects', from: '/docs/bonus'},
{to: '/docs/projects/ai-agent', from: '/docs/bonus/2026-ai-agent'},
{to: '/docs/projects/finetune-llm-unsloth', from: '/docs/bonus/2027-finetune-llm'},
],
},
],
[
'@docusaurus/plugin-pwa',
{
debug: false,
// 'always' (not just 'appInstalled'/'standalone'/'queryString', the
// plugin's own default) so precaching and offline serving work for
// every visitor, not only students who installed the app — this
// course's whole pitch is "works offline", and the precached
// manifest is just the Docusaurus build output (HTML/JS/CSS), not
// the much heavier JupyterLite/Pyodide payload, which lives outside
// this manifest and is loaded lazily/separately, so this doesn't
// meaningfully add to first-visit mobile data cost.
offlineModeActivationStrategies: ['always'],
pwaHead: [
{tagName: 'link', rel: 'icon', href: '/img/pwa/icon-192.png'},
{tagName: 'link', rel: 'manifest', href: '/manifest.json'},
{tagName: 'meta', name: 'theme-color', content: '#3ecc5f'},
{tagName: 'meta', name: 'apple-mobile-web-app-capable', content: 'yes'},
{tagName: 'meta', name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent'},
{tagName: 'link', rel: 'apple-touch-icon', href: '/img/pwa/apple-icon-180.png'},
],
},
],
],
themeConfig: {
image: 'img/social-card.jpg',
metadata: [
{
name: 'keywords',
content:
'python course, learn python, data analysis course, pandas tutorial, free python course, python for beginners, exploratory data analysis, jupyter, in-browser python',
},
],
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
docs: {
sidebar: {
hideable: false,
autoCollapseCategories: true,
},
},
navbar: {
title: 'PyDA Course',
logo: {
alt: 'Python & Data Analysis Course logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'python101Sidebar',
position: 'left',
label: 'Python 101',
},
{
type: 'docSidebar',
sidebarId: 'dataAnalysisSidebar',
position: 'left',
label: 'Data Analysis',
},
{
type: 'docSidebar',
sidebarId: 'projectsSidebar',
position: 'left',
label: 'Projects',
},
{to: '/progress', label: 'My Progress', position: 'right'},
{to: '/credits', label: 'Credits', position: 'right'},
{
type: 'localeDropdown',
position: 'right',
},
{
href: 'https://github.com/abderrahim-lectures/python-data-analysis-course',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Course',
items: [
{label: 'Python 101', to: '/docs/python-101'},
{label: 'Data Analysis', to: '/docs/data-analysis'},
{label: 'Projects', to: '/docs/projects'},
],
},
{
title: 'Site',
items: [
{label: 'My Progress', to: '/progress'},
{label: 'Credits', to: '/credits'},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/abderrahim-lectures/python-data-analysis-course',
},
{
label: 'Changelog',
href: 'https://github.com/abderrahim-lectures/python-data-analysis-course/blob/main/CHANGELOG.md',
},
],
},
],
// This English string is computed fresh on every build (year, version).
// Its translated counterparts in i18n/{ar,es,fr}/docusaurus-theme-classic/footer.json
// are static text (Docusaurus's i18n JSON files can't embed a dynamic
// template like this one) — bump those three "copyright" messages by
// hand whenever the version or year changes here, or they'll drift.
copyright: `Copyright © ${new Date().getFullYear()} Abderrahim Adrabi. Code MIT-licensed, content CC-BY 4.0. v${pkgVersion}`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['python', 'bash'],
},
} satisfies Preset.ThemeConfig,
};
export default config;