|
1 |
| -const remarkMath = require("remark-math"); |
2 |
| -const rehypeKatex = require("rehype-katex"); |
3 | 1 | const githubTheme = require("prism-react-renderer/themes/github");
|
4 | 2 | const draculaTheme = require("prism-react-renderer/themes/dracula");
|
5 | 3 |
|
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: "中文(简体)", |
50 | 18 | },
|
51 |
| - { |
52 |
| - href: "https://github.com/Computerization", |
53 |
| - label: "GitHub", |
54 |
| - position: "right", |
| 19 | + en: { |
| 20 | + label: "English", |
55 | 21 | },
|
56 |
| - ], |
| 22 | + }, |
57 | 23 | },
|
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", |
78 | 40 | },
|
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", |
87 | 91 | },
|
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, |
92 | 97 | },
|
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", |
107 | 98 | },
|
108 |
| - ], |
109 |
| - presets: [ |
110 |
| - [ |
111 |
| - "classic", |
| 99 | + stylesheets: [ |
112 | 100 | {
|
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", |
125 | 106 | },
|
126 | 107 | ],
|
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 | + }; |
128 | 134 | };
|
0 commit comments