-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocusaurus.config.ts
269 lines (250 loc) · 6.57 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
import type { PluginOptions as DocPlugOptions } from '@docusaurus/plugin-content-docs'
import type { PluginOptions as PagesPluginOptions } from '@docusaurus/plugin-content-pages'
import type { PluginOptions as IdealImagePluginOptions } from '@docusaurus/plugin-ideal-image'
import type { PluginOptions as SitemapPluginOptions } from '@docusaurus/plugin-sitemap'
import type { Config } from '@docusaurus/types'
import type { PluginOptions as SearchPluginOptions } from '@easyops-cn/docusaurus-search-local'
import { themes as prismThemes } from 'prism-react-renderer'
const ICON_PATH = 'img/icon.jpeg'
const config: Config = {
title: '$Li Wiki',
favicon: ICON_PATH,
tagline: 'The wiki of $Li and snowflake foundation',
url: 'https://www.li-dao.wiki',
baseUrl: '/',
// Help to simplify url
trailingSlash: false,
// Github Organization and Repo Name
organizationName: 'li-dao',
projectName: 'wiki',
deploymentBranch: 'gh-pages',
// Help search engines to index
noIndex: false,
// Lint and broken behavior
onBrokenLinks: 'throw',
onBrokenAnchors: 'warn',
onDuplicateRoutes: 'throw',
onBrokenMarkdownLinks: 'throw',
// Head tags
headTags: [
{
tagName: 'link',
attributes: {
rel: 'icon',
href: ICON_PATH,
},
},
{
tagName: 'link',
attributes: {
rel: 'apple-touch-icon',
href: ICON_PATH,
},
},
{
tagName: 'meta',
attributes: {
name: 'description',
content: 'The wiki of $Li and snowflake foundation; 雪花基金会和$Li的维基',
},
},
{
tagName: 'meta',
attributes: {
name: 'keywords',
content: 'wiki, $Li, snowflake, foundation, block chain, human rights, 维基, 雪花, 基金会, 区块链, 人权',
},
},
{
tagName: 'meta',
attributes: {
name: 'author',
content: 'Developer and Contributor of $Li',
},
},
],
// static directories
staticDirectories: ['static'],
i18n: {
defaultLocale: 'zh-CN',
locales: ['zh-CN', 'zh-TW', 'en'],
},
markdown: {
format: 'detect',
mermaid: true,
},
themes: [
'@docusaurus/theme-classic',
'@docusaurus/theme-mermaid',
'@docusaurus/theme-live-codeblock',
[
'@easyops-cn/docusaurus-search-local',
{
indexBlog: false,
indexDocs: true,
indexPages: false,
docsRouteBasePath: '/',
language: ['zh', 'en'],
hashed: 'query',
docsDir: 'wiki',
highlightSearchTermsOnTargetPage: true,
searchResultLimits: 10,
searchResultContextMaxLength: 50,
searchBarPosition: 'right',
} satisfies SearchPluginOptions,
],
],
themeConfig: {
// color mode
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
// social card
image: 'img/social-card.jpg', // TODO: need to set to real image
// announcementBar // TODO: need to be commented when the wiki is official released
announcementBar: {
id: 'work in progress',
content: 'This wiki is under construction',
backgroundColor: '#A5DD2DFF',
textColor: '#0A0B0EFF',
isCloseable: false,
},
// doc (wiki)
docs: {
versionPersistence: 'localStorage',
sidebar: {
hideable: true,
autoCollapseCategories: true,
},
},
// Blog, we do not need it for now
blog: undefined,
navbar: {
// title: 'Wiki of $Li',
title: '$Li | Snowflake Foundation | Wiki',
logo: {
alt: '$Li: The most dangerous cat',
src: ICON_PATH,
},
items: [
{
label: 'Official Website',
href: 'https://li-dao.wiki/404', // TODO: need to set to real url
position: 'left',
},
{
label: 'X',
href: 'https://x.com/Li_memecoin',
position: 'left',
},
{
label: 'Github',
href: 'https://github.com/li-dao',
position: 'left',
},
{
type: 'localeDropdown',
position: 'right',
dropdownItemsAfter: [
{
to: 'https://li-dao.wiki/404', // TODO: need to set to real url
label: 'Help us translate',
},
],
},
{
type: 'search',
position: 'right',
},
],
hideOnScroll: true,
},
footer: {
style: 'dark',
copyright: `Copyright © 2024 - ${new Date().getFullYear()} Developer and contributor of $Li all rights reserved. Under CC-BY-NC-SA 4.0`,
// links: [],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
},
plugins: [
[
'@docusaurus/plugin-content-docs',
{
path: 'wiki/',
sidebarPath: 'src/sidebars.ts',
sidebarCollapsed: true,
sidebarCollapsible: true,
include: ['**/*.{md,mdx}'],
exclude: ['template.md'],
routeBasePath: '/',
editUrl: 'https://github.com/li-dao/wiki',
editCurrentVersion: false,
editLocalizedFiles: true,
showLastUpdateTime: true,
} satisfies Partial<DocPlugOptions>,
],
[
'@docusaurus/plugin-content-pages',
{
path: 'src/pages',
routeBasePath: '/',
include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],
} satisfies Partial<PagesPluginOptions>,
],
[
'@docusaurus/plugin-debug',
{
debug: process.env.NODE_ENV !== 'production',
},
],
[
'@docusaurus/plugin-google-gtag',
{
trackingID: process.env.GOOGLE_ANALYTICS_ID ?? 'None',
anonymizeIP: true,
},
],
[
'@docusaurus/plugin-google-tag-manager',
{
containerId: process.env.GOOGLE_TAG_MANAGER_ID ?? 'None',
},
],
[
'@docusaurus/plugin-ideal-image',
{
name: 'ideal-img/[name].[hash:hex:7].[width].[ext]',
sizes: [128, 256, 512, 1024, 2048],
size: 1024,
min: 128,
max: 2048,
steps: 4,
quality: 80,
disableInDev: true,
} satisfies Partial<IdealImagePluginOptions>,
],
[
'@docusaurus/plugin-sitemap',
{
filename: 'sitemap.xml',
ignorePatterns: ['/404'],
lastmod: 'date',
changefreq: 'daily',
} satisfies Partial<SitemapPluginOptions>,
],
[
'@docusaurus/plugin-vercel-analytics',
{
mode: 'auto',
debug: true,
},
],
],
}
// biome-ignore lint/style/noDefaultExport: Required by Docusaurus
export default config