forked from pendle-finance/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.mjs
More file actions
285 lines (273 loc) · 7.42 KB
/
docusaurus.config.mjs
File metadata and controls
285 lines (273 loc) · 7.42 KB
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
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
/** @type {import('@docusaurus/types').DocusaurusConfig} */
const config = {
title: 'Pendle Documentation',
tagline: 'Pendle is a protocol that liberates future yield. It enables the tokenization and trading of future yield on a novel AMM designed to support assets with time decay.',
url: 'https://pendle.finance/',
baseUrl: '/',
trailingSlash: false,
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'ignore',
onBrokenAnchors: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'pendle-finance', // Usually your GitHub org/user name.
projectName: 'documentation', // Usually your repo name.
deploymentBranch: 'gh-pages',
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
id: 'default',
path: 'docs/pendle-v2',
breadcrumbs: true,
routeBasePath: 'pendle-v2',
sidebarPath: './docs/pendle-v2/sidebars.js',
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
exclude: ['**/Boros/**'],
},
gtag: {
trackingID: 'G-6ZBS49V0YS',
anonymizeIP: true,
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
themes: [
// ... Your other themes.
[
require.resolve("@easyops-cn/docusaurus-search-local"),
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
({
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
// For Docs using Chinese, it is recomended to set:
language: ["en", "zh"],
docsRouteBasePath: ["/pendle-v2", "/boros-dev"],
// Customize the keyboard shortcut to focus search bar (default is "mod+k"):
// searchBarShortcutKeymap: "s", // Use 'S' key
// searchBarShortcutKeymap: "ctrl+shift+f", // Use Ctrl+Shift+F
// If you're using `noIndex: true`, set `forceIgnoreNoIndex` to enable local index:
// forceIgnoreNoIndex: true,
}),
],
],
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
createRedirects(existingPath) {
// For paths like /Developer/SomeDocs, redirect to /pendle-v2/Developer/SomeDocs
if (existingPath.includes('/pendle-v2/')) {
const pathWithoutPrefix = existingPath.replace('/pendle-v2/', '/');
return [pathWithoutPrefix];
}
return undefined;
},
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'boros-dev',
path: 'docs/boros-dev-docs',
routeBasePath: 'boros-dev',
sidebarPath: './docs/boros-dev-docs/sidebars.js',
breadcrumbs: true,
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'pendle-academy',
path: 'docs/pendle-academy',
routeBasePath: 'pendle-academy',
sidebarPath: './docs/pendle-academy/sidebars.js',
breadcrumbs: true,
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
],
[
'@docusaurus/plugin-sitemap',
{
id: 'sitemap',
lastmod: 'date',
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
createSitemapItems: async (params) => {
const {defaultCreateSitemapItems, ...rest} = params;
const items = await defaultCreateSitemapItems(rest);
return items.filter((item) => !item.url.includes('/page/'));
},
},
],
],
stylesheets: [
{
href: "https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css",
integrity: "sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc",
crossorigin: "anonymous",
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
{
algolia: {
appId: "GFVY0GOMCR",
apiKey: "1e9c713dfca40c64b56217bb24d5c4cd",
indexName: "pendle",
contextualSearch: true,
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: false,
},
docs:{
sidebar: {
hideable: false
}
},
navbar: {
logo: {
alt: 'Pendle Logo',
src: 'img/logo.svg',
srcDark: 'img/logo.svg',
},
title: 'Pendle Documentation',
items: [
{
type: 'dropdown',
label: 'Pendle V2',
position: 'left',
items: [
{
to: '/pendle-v2/Introduction',
label: 'Pendle V2 Docs',
},
{
href: 'https://pendle.gitbook.io/pendle-academy/',
label: 'Pendle Academy',
}
]
},
{
type: 'dropdown',
label: 'Boros',
position: 'left',
items: [
{
to: '/boros-dev',
label: 'Boros Dev Docs',
},
{
href: 'https://pendle.gitbook.io/boros/boros-docs',
label: 'Boros Docs',
},
{
href: 'https://pendle.gitbook.io/boros',
label: 'Boros Academy',
},
],
}
],
},
footer: {
style: 'light',
links: [
{
title: 'Pages',
items: [
{
label: 'Website',
href: 'https://pendle.finance',
},
{
label: 'App',
href: 'https://app.pendle.finance',
},
],
},
{
title: 'Socials',
items: [
{
label: 'Discord',
href: 'https://discord.gg/qshFxh6965/',
},
{
label: 'Twitter',
href: 'https://twitter.com/pendle_fi/',
},
{
label: 'Telegram',
href: 'https://t.me/pendlefinance/',
},
],
},
{
title: 'About Us',
items: [
{
label: 'Medium',
href: 'https://medium.com/pendle/',
},
{
label: 'Careers',
href: 'https://angel.co/company/pendle_finance/',
},
{
label: 'Media Kit',
href: 'https://www.pendle.finance/brandguide',
},
{
label: 'Audits',
href: 'https://github.com/pendle-finance/pendle-core-v2-public/tree/main/audits'
}
],
},
],
logo: {
alt: 'Pendle Finance Logo',
src: 'img/logo.svg',
href: 'https://pendle.finance',
},
copyright: `Copyright © ${new Date().getFullYear()} Pendle Finance`,
},
prism: {
additionalLanguages: ["solidity"],
},
},
i18n: {
defaultLocale: 'en',
locales: ['en', 'cn'],
path: 'i18n',
localeConfigs: {
en: {
label: 'English',
direction: 'ltr',
htmlLang: 'en-US',
calendar: 'gregory',
},
cn: {
label: '中文(中国)',
direction: 'ltr',
htmlLang: 'zh-Hans',
calendar: 'gregory',
},
},
},
};
export default config;