-
Notifications
You must be signed in to change notification settings - Fork 3
/
docusaurus.config.js
185 lines (178 loc) · 4.62 KB
/
docusaurus.config.js
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
const lightCodeTheme = require('prism-react-renderer/themes/github')
const darkCodeTheme = require('prism-react-renderer/themes/dracula')
const trailingSlash = false
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
// 站点元数据
title: 'everPay Docs',
baseUrl: '/',
favicon: 'img/favicon.png',
// 部署 github 配置
// https://docusaurus.io/zh-CN/docs/deployment#deploying-to-github-pages
organizationName: 'everFinance', // Usually your GitHub org/user name.
projectName: 'docs', // Usually your repo name.
url: 'https://docs.everpay.io',
baseUrl: '/',
trailingSlash,
// 一般部署至托管商需要:结尾斜杠,不同的服务托管商需要
// https://docusaurus.io/zh-CN/docs/deployment#trailing-slashes
// https://docusaurus.io/zh-CN/docs/docusaurus.config.js#trailing-slash
// trailingSlash
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'zh-cn',
locales: ['en', 'zh-cn'],
localeConfigs: {
en: {
label: 'English',
direction: 'ltr'
},
'zh-cn': {
label: '简体中文',
direction: 'ltr'
}
}
},
// 预设配置
presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: require.resolve('./src/css/custom.css')
},
// 传递至 @docusaurus/plugin-content-docs
docs: {
sidebarCollapsible: false,
sidebarPath: require.resolve('./sidebars.js'),
editUrl: ({ locale, versionDocsDirPath, docPath }) => {
if (locale === 'en') {
return `https://github.com/everFinance/docs/edit/master/i18n/${locale}/docusaurus-plugin-content-docs/current/${docPath}`
}
return `https://github.com/everFinance/docs/edit/master/docs/${docPath}`
}
},
gtag: {
trackingID: 'GTM-PZ2J4TP',
anonymizeIP: false
},
// 传递至 @docusaurus/plugin-content-blog(设置为 false 以禁用)
blog: false,
sitemap: {
changefreq: 'weekly',
priority: 0.5
}
}
]
],
// 主题
// themes:
themeConfig: {
colorMode: {
defaultMode: 'light',
disableSwitch: false, // Don't show manual switch
respectPrefersColorScheme: true // But respect user preference!
},
navbar: {
title: 'everPay',
logo: {
alt: 'everPay Logo',
src: 'img/logo-black.svg',
srcDark: 'img/logo-white.svg'
},
items: [
{
type: 'doc',
docId: 'guide/overview',
position: 'left',
label: 'DOCS'
},
// {
// type: 'doc',
// docId: 'sdk/intro',
// position: 'left',
// label: 'SDK',
// },
{
type: 'localeDropdown',
position: 'right'
},
{
href: 'https://github.com/everFinance/docs',
label: 'GitHub',
position: 'right'
}
]
},
footer: {
style: 'dark',
links: [
{
title: '文档',
items: [
{
label: 'DOCS',
to: '/docs/guide/overview'
}
// {
// label: 'SDK',
// to: '/docs/sdk/intro',
// }
]
},
{
title: 'GitHub',
items: [
{
label: 'docs',
href: 'https://github.com/everFinance/docs'
},
{
label: 'everpay-js',
href: 'https://github.com/everFinance/everpay-js'
}
]
},
{
title: '社区',
items: [
{
label: 'Twitter',
href: 'https://twitter.com/everVisionHQ'
},
{
label: 'Discord',
href: 'https://discord.gg/WM5MQZGVPF'
},
{
label: 'Medium',
href: 'https://news.ever.vision'
}
]
},
{
title: '支持',
items: [
{
label: '帮助中心',
href: 'https://discord.gg/xGfYrNeqT8'
}
]
}
],
copyright: `Copyright © ${new Date().getFullYear()} everVision, Inc. Built with Docusaurus.`
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme
},
algolia: {
// 自己生成索引需要
appId: 'AI0VA1UPRC',
apiKey: '35a05c3168caead7419515e910de2c96',
indexName: 'docs',
js_render: true
}
}
}