-
Notifications
You must be signed in to change notification settings - Fork 2
/
docusaurus.config.ts
133 lines (120 loc) · 4.12 KB
/
docusaurus.config.ts
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
import axios from 'axios';
import { themes as prismThemes } from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import docusaurusLunrSearchPlugin from 'docusaurus-lunr-search';
module.exports = async function configCreatorAsync() {
const contact_info = await axios.get(
"https://raw.githubusercontent.com/dsmtE/dsmtE/main/contact.json"
).then((res) => res.data).catch((err) => ({}));
const rehypeKatex = (await import('rehype-katex')).default;
const remarkMath = (await import('remark-math')).default;
const config: Config = {
title: 'Cours de programmation C++',
tagline: '',
url: `https://dsmte.github.io/`,
baseUrl: '/Learn--cpp_programming/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'imgs/favicon.ico',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'dsmtE', // Usually your GitHub org/user name.
projectName: 'Learn--cpp_programming', // Usually your repo name.
i18n: {
defaultLocale: 'fr',
locales: ['fr'],
},
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
plugins: [[ docusaurusLunrSearchPlugin, {
languages: ['fr'],
includeRoutes: ['**/Lessons/**', '**/TDs/**', '**/Annexes/**', '**/Workshop/**', '**/Subjects/**'],
}]],
presets: [
[
'classic',
{
docs: {
path: "./content",
routeBasePath: "/",
sidebarPath: require.resolve('./sidebars.js'),
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
} satisfies Preset.Options,
],
],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css",
integrity:
"sha384-MlJdn/WNKDGXveldHDdyRP1R4CTHr3FeuDNfhsLPYrq2t0UBkUdK2jyTnXPEK1NQ",
crossorigin: "anonymous",
},
],
themeConfig: {
navbar: {
title: '',
logo: {
alt: 'Logo',
src: 'imgs/logo.svg',
},
items: [
{to: '/Lessons', label: 'Cours', position: 'left'},
{to: '/TDs', label: 'TDs', position: 'left'},
{to: '/Annexes', label: 'Annexes', position: 'left'},
{to: '/Workshop', label: 'Workshop', position: 'left'},
{to: '/Subjects', label: 'Sujets', position: 'left'},
{to: '/Sources', label: 'Sources', position: 'right'},
],
},
docs: {
sidebar: {
hideable: true,
},
},
footer: {
style: 'dark',
links: [
{
// label: "Discord",
// to: `https://discord.com/users/${contact_info.discord_user_id}`,
html: `
<a href="https://discord.com/users/${contact_info.discord_user_id}" class="footer__link-item">
<img src="https://api.iconify.design/skill-icons/discord.svg" /> Discord
</a>
`,
},
{
label: "E-Mail",
to: `mailto:${contact_info.email}`,
},
{
// label: "GitHub",
// to: "https://github.com/dsmtE",
html: `
<a href="https://github.com/dsmtE" class="footer__link-item">
<img src="https://api.iconify.design/skill-icons/github-dark.svg" /> GitHub
</a>
`,
},
],
copyright:
`These lessons were written by <a href="https://github.com/dsmtE">DE SMET Enguerrand</a>.</br>` +
`Copyright © ${new Date().getFullYear()}. Built with <a href="https://docusaurus.io/">Docusaurus</a>.`
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ["cmake", "csharp"],
},
} satisfies Preset.ThemeConfig,
};
return config;
};