-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocusaurus.config.ts
306 lines (289 loc) · 8.95 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type {Options as IdealImageOptions} from '@docusaurus/plugin-ideal-image';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
const config: Config = {
title: 'lailai\'s Home',
tagline: '光锥之内,就是命运。',
favicon: 'img/favicon.ico',
// Set the production url of your site here
url: 'https://lailai0916.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'lailai0916', // Usually your GitHub org/user name.
projectName: 'lailai\'s Home', // Usually your repo name.
trailingSlash: false,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans'],
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
// showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl: 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: {
showReadingTime: true,
blogTitle: '博客',
blogDescription: 'lailai\'s Blog',
postsPerPage: 'ALL',
blogSidebarTitle: '文章列表',
blogSidebarCount: 'ALL',
feedOptions: {
type: ['rss', 'atom'],
xslt: true,
},
// showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl: 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// Useful options to enforce blogging best practices
onInlineTags: 'warn',
onInlineAuthors: 'warn',
onUntruncatedBlogPosts: 'warn',
},
pages: {
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
// Replace with your project's social card
image: 'img/logo.svg',
navbar: {
// hideOnScroll: true,
title: 'lailai\'s Home',
logo: {
alt: 'lailai\'s Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'docs1',
position: 'left',
label: '竞赛',
},
{
type: 'docSidebar',
sidebarId: 'docs2',
position: 'left',
label: '笔记',
},
{
type: 'docSidebar',
sidebarId: 'docs3',
position: 'left',
label: '项目',
},
{
to: 'blog',
label: '博客',
position: 'left'
},
{
to: 'about',
label: '关于',
position: 'right'
},
{
label: '更多',
position: 'right',
items: [
{ label: '友链', to: 'friend' },
{ label: '网站', to: 'site' },
{ label: '设置', to: 'set' },
],
},
{
href: 'https://github.com/lailai0916/lailai0916.github.io',
// label: 'GitHub',
className: 'header-github-link',
position: 'right',
},
],
},
footer: {
links: [
{
title: '文档',
items: [
{
label: '竞赛',
to: 'docs/contest',
},
{
label: '笔记',
to: 'docs/note',
},
{
label: '项目',
to: 'docs/project',
},
],
},
{
title: '社区',
items: [
{
label: 'Telegram',
href: 'https://t.me/lailai0916',
},
{
label: 'LinkedIn',
href: 'https://www.linkedin.com/in/lailai0916',
},
{
label: 'X',
href: 'https://x.com/lailai0x394',
},
],
},
{
title: '更多',
items: [
{
label: '博客',
to: 'blog',
},
{
label: '关于',
to: 'about',
},
{
label: '设置',
to: 'set',
},
],
},
],
copyright: `Copyright © 2024-${new Date().getFullYear()} lailai. Built with <a href="https://docusaurus.io" target="_blank">Docusaurus</a>. <p xmlns:cc="http://creativecommons.org/ns#" >This website's content is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC-SA 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1" alt=""></a></p>`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
colorMode: {
respectPrefersColorScheme: true,
},
docs: {
sidebar: {
hideable: true,
// autoCollapseCategories: true,
},
},
// announcementBar: {
// id: 'announcement',
// content: '🎊 Hello, 2025! 🎊',
// backgroundColor: '#ffffff',
// textColor: '#000000',
// isCloseable: true,
// },
} satisfies Preset.ThemeConfig,
markdown: {
mermaid: true,
},
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity: 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
themes: [
// ... Your other themes.
'@docusaurus/theme-mermaid',
'@docusaurus/theme-live-codeblock',
[
// https://github.com/easyops-cn/docusaurus-search-local
require.resolve("@easyops-cn/docusaurus-search-local"),
({
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
// For Docs using Chinese, The `language` is recommended to set to:
// ```
// language: ["en", "zh"],
// language: "zh",
// ```
language: ["en", "zh"],
indexDocs: true, // 是否对docs进行索引
indexBlog: true, // 是否对blog进行索引
indexPages: false, // 是否对pages进行索引
docsRouteBasePath: ["/docs","/linux","/services"],
}),
],
],
plugins: [
async function tailwindcssPlugin() {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require('tailwindcss'))
postcssOptions.plugins.push(require('autoprefixer'))
return postcssOptions
},
}
},
[
'ideal-image',
{
quality: 70,
max: 1030,
min: 640,
steps: 2,
// Use false to debug, but it incurs huge perf costs
disableInDev: true,
} satisfies IdealImageOptions,
],
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
from: '/v50',
to: 'https://v50to.me',
},
],
},
],
[
'@docusaurus/plugin-google-gtag',
{
trackingID: 'G-HGRTVZK8MR',
anonymizeIP: true,
},
],
],
};
export default config;