-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdocusaurus.config.ts
159 lines (151 loc) · 5.17 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
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
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type { PluginOptions as LocalSearchPluginOptions } from '@easyops-cn/docusaurus-search-local';
import { themes as PrismThemes } from 'prism-react-renderer';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
export default {
title: '洛谷帮助中心',
favicon: 'img/favicon.ico',
url: 'https://help.luogu.com.cn',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans']
},
markdown: {
mdx1Compat: {
comments: false,
admonitions: false,
headingIds: true /* until they provide a new syntax */
}
},
presets: [
['@docusaurus/preset-classic', {
blog: false,
pages: {},
docs: {
sidebarPath: './sidebars.ts',
async sidebarItemsGenerator(context) {
const { item, defaultSidebarItemsGenerator } = context;
const finalItems = await defaultSidebarItemsGenerator(context);
if(item.dirName === 'manual/class') {
finalItems.splice(1, 0, { type: 'ref', id: 'manual/luogu/team/premium' });
}
return finalItems;
},
routeBasePath: '/',
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex]
},
theme: {
customCss: './src/style.css'
}
} satisfies Preset.Options]
],
themes: [
['@easyops-cn/docusaurus-search-local', {
indexDocs: true,
indexBlog: false,
docsRouteBasePath: ["/rules", "/manual", "/ula"],
language: ["en", "zh"],
hashed: true
} satisfies LocalSearchPluginOptions]
],
stylesheets: [{
href: 'https://cdn.luogu.com.cn/assets/katex:0.16.7/katex.min.css',
type: 'text/css',
integrity: 'sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI',
crossorigin: 'anonymous',
}],
themeConfig: {
navbar: {
title: '洛谷帮助中心',
logo: {
alt: 'Luogu',
src: 'img/logo.png'
},
items: [{
type: 'doc',
docId: 'rules/community/index',
position: 'left',
label: '社区规则'
}, {
type: 'doc',
docId: 'rules/academic/index',
position: 'left',
label: '学术规范'
}, {
type: 'doc',
docId: 'manual/luogu/index',
position: 'left',
label: '主站操作指南'
}, {
type: 'doc',
docId: 'manual/class/index',
position: 'left',
label: '网校与付费服务'
}, {
href: 'https://www.luogu.com.cn',
label: '洛谷',
position: 'right'
}]
},
footer: {
style: 'dark',
copyright: `
Copyright © ${new Date().getFullYear()} 上海洛谷网络科技有限公司. Built with Docusaurus.<br />
<small><a href="http://beian.miit.gov.cn" target="_blank">沪ICP备18008322号</a></small>
`,
links: [{
title: '洛谷',
items: [{
label: '洛谷主站',
href: 'https://www.luogu.com.cn',
}, {
label: '洛谷网校',
href: 'https://class.luogu.com.cn',
}, {
label: '洛谷有题',
href: 'https://ti.luogu.com.cn',
}, {
label: '洛谷开放平台',
href: 'https://docs.lgapi.cn/open',
}]
}, {
title: '用户协议',
items: [{
label: '洛谷用户协议',
to: '/ula/luogu',
}, {
label: '洛谷网校用户协议',
to: '/ula/class',
}, {
label: '洛谷高级团队服务章程',
to: '/ula/premium-team',
}]
}, {
title: '更多',
items: [ {
label: '主站更新日志',
to: '/release-note',
}, {
label: '关于我们',
to: '/about-us',
}, {
label: '联系我们',
to: '/contact-us',
}, {
label: 'GitHub 仓库',
href: 'https://github.com/luogu-dev/docs',
}]
}]
},
prism: {
theme: PrismThemes.github,
darkTheme: PrismThemes.dracula
}
} satisfies Preset.ThemeConfig
} satisfies Config;