-
Notifications
You must be signed in to change notification settings - Fork 5
/
docusaurus.config.ts
206 lines (194 loc) · 5.78 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
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
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import * as path from "node:path";
const config: Config = {
title: 'west2-online',
tagline: '福州大学西二在线工作室',
favicon: 'img/favicon.ico',
url: 'https://site.west2.online',
baseUrl: '/',
// Github pages 配置
organizationName: 'west2-online', // Github Organization 名称
projectName: 'website', // 仓库名称
deploymentBranch: 'gh-pages', // 部署分支
trailingSlash: false, // 是否保留尾部斜杠
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// 国际化,不过我们只需要中文就行了
i18n: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans'],
},
// 预设
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
editUrl: // 编辑路径前缀
'https://github.com/west2-online/website/tree/main/',
sidebarCollapsed: true,
},
blog: {
showReadingTime: true,
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
// 插件
plugins: [
function aliasPlugin() {
return {
name: "alias-plugin",
configureWebpack(config) {
return {
resolve: {
alias: {
"@": path.resolve(__dirname, 'src/')
},
},
};
},
}
},
async function tailwindPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
],
// 主题配置
themeConfig: {
// 色彩模式
colorMode: {
defaultMode: 'light',
disableSwitch: true,
respectPrefersColorScheme: false,
},
// 首页置顶的公告栏,尽量一句话结束
announcementBar: {
id: 'new_info',
content:
'我们发布了工作室成员 2024 开源之夏活动课题申请书! <a target="_blank" rel="noopener noreferrer" href="https://west2-online.feishu.cn/wiki/XxpXwqtWkiALUwk6ZCqcd6gCnBe">点击查看</a>',
backgroundColor: '#fafbfc',
textColor: '#091E42',
isCloseable: false,
},
// 导航栏
navbar: {
title: 'west2-online',
logo: {
alt: 'west2-online logo',
src: 'img/logo.svg',
},
items: [
{
to: '/docs/member',
position: 'left',
label: '成员列表',
},
{
type: 'dropdown',
label: '培养方案',
position: 'left',
items: [
{
label: 'AI',
href: 'https://github.com/west2-online/learn-AI',
},
{
label: 'Android',
href: 'https://github.com/west2-online/learn-android',
},
{
label: 'frontends',
href: 'https://github.com/west2-online/learn-frontends',
},
{
label: 'Go',
href: 'https://github.com/west2-online/learn-go',
},
{
label: 'HarmonyOS',
href: 'https://github.com/west2-online/learn-HarmonyOS',
},
{
label: 'Java',
href: 'https://github.com/west2-online/learn-java',
},
{
label: 'Unity',
href: 'https://github.com/west2-online/learn-unity',
},
],
},
{
type: 'dropdown',
label: '产品直达',
position: 'left',
items: [
{
label: '福uu(福大助手)',
href: 'https://fzuhelper.w2fzu.com/',
},
{
label: '飞跃手册',
href: 'https://run.west2.online/',
},
{
label: '校园指南',
href: 'https://fzuwiki.west2.online/',
},
],
},
{
href: 'https://wiki.west2.online',
label: 'Wiki',
position: 'right',
},
{
href: 'https://github.com/west2-online',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
],
},
// 页脚
footer: {
style: 'dark',
links: [
{
html: `
<div style="display: flex; justify-content: center; align-items: center; color:#FFF;">
<span>本网站由</span>
<a target="_blank" rel="noopener noreferrer" href="https://www.upyun.com/?from=xi2" style="display: inline-flex; align-items: center;">
<img src="/img/upyun_logo.svg" alt="又拍云" height= "20px" style="margin: 0 5px;" />
</a>
<span>提供CDN加速/云存储服务</span>
</div>
`
}
],
copyright: `版权所有 © ${new Date().getFullYear()} west2-online. 网站使用 Docusaurus 构建.<div/> <a href="https://beian.miit.gov.cn/#/Integrated/index">闽ICP备19020557号-3</a> <img src="/img/beian.png" height="14px" width="14px"style="margin: 0 5px;"/>闽公网安备35018302000171号`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};
export default config;