Skip to content

Commit 6afa114

Browse files
authored
chore(deps): Docusaurus v3! (#534)
* chore(deps): Docusaurus v3! * prettify code * fix misinterpretation of `<` (U+003C)
1 parent 8e1c47e commit 6afa114

File tree

5 files changed

+3703
-925
lines changed

5 files changed

+3703
-925
lines changed

docs/about-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: Creative Commons Attribution 4.0 International License
88

99
### 我们的名字
1010

11-
**C 社 << Computerization << 世外信息化社** 我们的全称是 Computerization,世外信息化社;不过我们更喜欢被称之为 C 社,一是因为简洁明快,二也是因为与 C 语言同名(笑)
11+
**C 社 {'<<'} Computerization {'<<'} 世外信息化社** 我们的全称是 Computerization,世外信息化社;不过我们更喜欢被称之为 C 社,一是因为简洁明快,二也是因为与 C 语言同名(笑)
1212

1313
### 我们对 CS 的看法
1414

docusaurus.config.js

Lines changed: 120 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,134 @@
1-
const remarkMath = require("remark-math");
2-
const rehypeKatex = require("rehype-katex");
31
const githubTheme = require("prism-react-renderer/themes/github");
42
const draculaTheme = require("prism-react-renderer/themes/dracula");
53

6-
module.exports = {
7-
title: "Computerization",
8-
tagline: "C社 << Computerization << 世外信息化社",
9-
url: "https://computerization.io",
10-
baseUrl: "/",
11-
favicon: "img/favicon/favicon.ico",
12-
trailingSlash: true,
13-
i18n: {
14-
defaultLocale: "zh-Hans",
15-
locales: ["zh-Hans", "en"],
16-
localeConfigs: {
17-
"zh-Hans": {
18-
label: "中文(简体)",
19-
},
20-
en: {
21-
label: "English",
22-
},
23-
},
24-
},
25-
plugins: ["alumni"],
26-
themeConfig: {
27-
announcementBar: {
28-
id: "join_us",
29-
content:
30-
'<b>🎉 C社2023届开始招新啦</b>! <a target="_blank" rel="noopener noreferrer" href="https://mp.weixin.qq.com/s/K-qGy7XPybCxq0WBl9DV0A">了解更多</a>',
31-
backgroundColor: "#22292f",
32-
textColor: "#FFFFFF",
33-
isCloseable: false,
34-
},
35-
navbar: {
36-
title: "世外信息化社",
37-
logo: {
38-
alt: "Computerization Logo",
39-
src: "img/logo.svg",
40-
srcDark: "img/logo.svg",
41-
},
42-
43-
items: [
44-
{ to: "alumni", label: "往届成员", position: "left" },
45-
{ to: "docs/about-us", label: "文档", position: "left" },
46-
{ to: "blog", label: "博客", position: "left" },
47-
{
48-
type: "localeDropdown",
49-
position: "right",
4+
module.exports = async function createConfigAsync() {
5+
return {
6+
title: "Computerization",
7+
tagline: "C社 << Computerization << 世外信息化社",
8+
url: "https://computerization.io",
9+
baseUrl: "/",
10+
favicon: "img/favicon/favicon.ico",
11+
trailingSlash: true,
12+
i18n: {
13+
defaultLocale: "zh-Hans",
14+
locales: ["zh-Hans", "en"],
15+
localeConfigs: {
16+
"zh-Hans": {
17+
label: "中文(简体)",
5018
},
51-
{
52-
href: "https://github.com/Computerization",
53-
label: "GitHub",
54-
position: "right",
19+
en: {
20+
label: "English",
5521
},
56-
],
22+
},
5723
},
58-
footer: {
59-
style: "dark",
60-
links: [
61-
{
62-
title: "文档",
63-
items: [
64-
{
65-
label: "文档",
66-
to: "docs/about-us",
67-
},
68-
],
69-
},
70-
{
71-
title: "社区",
72-
items: [
73-
{
74-
label: "GitHub",
75-
href: "https://github.com/Computerization",
76-
},
77-
],
24+
plugins: ["alumni"],
25+
themeConfig: {
26+
announcementBar: {
27+
id: "join_us",
28+
content:
29+
'<b>🎉 C社2023届开始招新啦</b>! <a target="_blank" rel="noopener noreferrer" href="https://mp.weixin.qq.com/s/K-qGy7XPybCxq0WBl9DV0A">了解更多</a>',
30+
backgroundColor: "#22292f",
31+
textColor: "#FFFFFF",
32+
isCloseable: false,
33+
},
34+
navbar: {
35+
title: "世外信息化社",
36+
logo: {
37+
alt: "Computerization Logo",
38+
src: "img/logo.svg",
39+
srcDark: "img/logo.svg",
7840
},
79-
{
80-
title: "社交",
81-
items: [
82-
{
83-
label: "博客",
84-
to: "blog",
85-
},
86-
],
41+
42+
items: [
43+
{ to: "alumni", label: "往届成员", position: "left" },
44+
{ to: "docs/about-us", label: "文档", position: "left" },
45+
{ to: "blog", label: "博客", position: "left" },
46+
{
47+
type: "localeDropdown",
48+
position: "right",
49+
},
50+
{
51+
href: "https://github.com/Computerization",
52+
label: "GitHub",
53+
position: "right",
54+
},
55+
],
56+
},
57+
footer: {
58+
style: "dark",
59+
links: [
60+
{
61+
title: "文档",
62+
items: [
63+
{
64+
label: "文档",
65+
to: "docs/about-us",
66+
},
67+
],
68+
},
69+
{
70+
title: "社区",
71+
items: [
72+
{
73+
label: "GitHub",
74+
href: "https://github.com/Computerization",
75+
},
76+
],
77+
},
78+
{
79+
title: "社交",
80+
items: [
81+
{
82+
label: "博客",
83+
to: "blog",
84+
},
85+
],
86+
},
87+
],
88+
logo: {
89+
alt: "Computerization Logo",
90+
src: "img/logo.svg",
8791
},
88-
],
89-
logo: {
90-
alt: "Computerization Logo",
91-
src: "img/logo.svg",
92+
copyright: `世外信息化社 © ${new Date().getFullYear()} 版权所有. 使用 Docusaurus 搭建.`,
93+
},
94+
prism: {
95+
theme: githubTheme,
96+
darkTheme: draculaTheme,
9297
},
93-
copyright: `世外信息化社 © ${new Date().getFullYear()} 版权所有. 使用 Docusaurus 搭建.`,
94-
},
95-
prism: {
96-
theme: githubTheme,
97-
darkTheme: draculaTheme,
98-
},
99-
},
100-
stylesheets: [
101-
{
102-
href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css",
103-
type: "text/css",
104-
integrity:
105-
"sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X",
106-
crossorigin: "anonymous",
10798
},
108-
],
109-
presets: [
110-
[
111-
"classic",
99+
stylesheets: [
112100
{
113-
docs: {
114-
sidebarPath: require.resolve("./sidebars.js"),
115-
remarkPlugins: [remarkMath],
116-
rehypePlugins: [[rehypeKatex, { strict: false }]],
117-
},
118-
blog: {
119-
remarkPlugins: [remarkMath],
120-
rehypePlugins: [[rehypeKatex, { strict: false }]],
121-
},
122-
theme: {
123-
customCss: require.resolve("./src/css/custom.css"),
124-
},
101+
href: "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css",
102+
type: "text/css",
103+
integrity:
104+
"sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X",
105+
crossorigin: "anonymous",
125106
},
126107
],
127-
],
108+
presets: [
109+
[
110+
"classic",
111+
{
112+
docs: {
113+
sidebarPath: require.resolve("./sidebars.js"),
114+
remarkPlugins: [(await import("remark-math")).default],
115+
rehypePlugins: [
116+
(await import("rehype-katex")).default,
117+
{ strict: false },
118+
],
119+
},
120+
blog: {
121+
remarkPlugins: [(await import("remark-math")).default],
122+
rehypePlugins: [
123+
(await import("rehype-katex")).default,
124+
{ strict: false },
125+
],
126+
},
127+
theme: {
128+
customCss: require.resolve("./src/css/custom.css"),
129+
},
130+
},
131+
],
132+
],
133+
};
128134
};

i18n/en/docusaurus-plugin-content-docs/current/about-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We are a refined CS community always working behind the scenes to provide commun
88

99
### Our Name
1010

11-
**C 社 << Computerization << 世外信息化社** Our full name is the Computerization club, 世外信息化社; But we would prefer to be called Computerization (in Chinese, C 社), since it's more concise, plus it has the same name as the C Programming Language (\*Laugh\*) Our English name, though, is always Computerization.
11+
**C 社 {'<<'} Computerization {'<<'} 世外信息化社** Our full name is the Computerization club, 世外信息化社; But we would prefer to be called Computerization (in Chinese, C 社), since it's more concise, plus it has the same name as the C Programming Language (\*Laugh\*) Our English name, though, is always Computerization.
1212

1313
### Our opinion on CS
1414

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
"prepare": "husky install"
2020
},
2121
"dependencies": {
22-
"@docusaurus/core": "latest",
23-
"@docusaurus/preset-classic": "latest",
24-
"@docusaurus/theme-classic": "latest",
25-
"@mdx-js/react": "1.6.22",
22+
"@docusaurus/core": "3.0.0-beta.0",
23+
"@docusaurus/preset-classic": "3.0.0-beta.0",
24+
"@docusaurus/theme-classic": "3.0.0-beta.0",
25+
"@mdx-js/react": "2.3.0",
2626
"clsx": "2.0.0",
2727
"docusaurus-plugin-alumni": "0.0.0",
2828
"prism-react-renderer": "1.3.3",
29-
"react": "18.1.0",
30-
"react-dom": "18.1.0",
31-
"rehype-katex": "5.0.0",
32-
"remark-math": "3.0.1"
29+
"react": "18.0.0",
30+
"react-dom": "18.0.0",
31+
"rehype-katex": "^6.0.3",
32+
"remark-math": "^5.1.1"
3333
},
3434
"browserslist": {
3535
"production": [
@@ -44,9 +44,10 @@
4444
]
4545
},
4646
"devDependencies": {
47-
"@docusaurus/module-type-aliases": "latest",
48-
"@docusaurus/types": "latest",
49-
"@tsconfig/docusaurus": "2.0.0",
47+
"@docusaurus/eslint-plugin": "3.0.0-beta.0",
48+
"@docusaurus/module-type-aliases": "3.0.0-beta.0",
49+
"@docusaurus/tsconfig": "3.0.0-beta.0",
50+
"@docusaurus/types": "3.0.0-beta.0",
5051
"@types/node": "18.17.17",
5152
"@types/react": "18.0.12",
5253
"@typescript-eslint/eslint-plugin": "5.27.1",

0 commit comments

Comments
 (0)