-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
229 lines (218 loc) · 6.27 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
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
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/vsDark');
const { webpackPlugin } = require('./plugins/webpack-plugin.cjs');
const tailwindPlugin = require('./plugins/tailwind-plugin.cjs');
const plugins = [tailwindPlugin, webpackPlugin];
const fs = require('fs');
const resourcesHTML = fs.readFileSync('./src/snippets/resources.html', 'utf-8');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Chat2DB',
tagline: '一款开源免费的支持Mysql、Oracle、PostgreSQL等数据库的客户端工具🚀',
favicon: 'favicon.svg',
url: 'https://chat2db.ai',
baseUrl: '/',
organizationName: 'chat2db',
projectName: 'chat2db',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars-default.js'),
editUrl: 'https://github.com/chat2db/chat2db-website/tree/main/',
breadcrumbs: false,
},
theme: {
customCss: [require.resolve('./src/css/custom.css')],
},
// 设置谷歌数据分析
gtag: {
trackingID: 'G-HLJ1ZEFTZM',
anonymizeIP: true,
},
}),
],
],
plugins: [
[
// 这里新增一个 多个doc的插件 专门用来 管理 社区 可以参考:https://docusaurus.io/docs/docs-multi-instance
// 为什么不用docs一起? 因为 社区 不需要版本管理
'@docusaurus/plugin-content-docs',
{
id: 'community',
path: 'community',
routeBasePath: 'community',
sidebarPath: require.resolve('./sidebarsCommunity.js'),
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'group',
path: 'group',
routeBasePath: 'group',
sidebarPath: require.resolve('./sidebarsGroup.js'),
},
],
// 接入开源官网的流量统计
[
'docusaurus-plugin-includes',
{
injectedHtmlTags: {
headTags: [
{
tagName: 'meta',
attributes: {
name: 'aes-config',
content:
'pid=xux-opensource&user_type=101&uid=&username=&dim10=Chat2DB',
},
},
],
preBodyTags: [
{
tagName: 'script',
attributes: {
src: '//g.alicdn.com/alilog/mlog/aplus_v2.js',
id: 'beacon-aplus',
exparams: 'clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx',
async: true,
},
},
{
tagName: 'script',
attributes: {
src: '//g.alicdn.com/aes/??tracker/1.0.34/index.js,tracker-plugin-pv/2.4.5/index.js,tracker-plugin-event/1.2.5/index.js,tracker-plugin-jserror/1.0.13/index.js,tracker-plugin-api/1.1.14/index.js,tracker-plugin-perf/1.1.8/index.js,tracker-plugin-eventTiming/1.0.4/index.js',
async: true,
},
},
],
},
},
],
...plugins,
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'favicon.svg',
navbar: {
logo: {
href: '/',
src: 'favicon.svg',
srcDark: 'favicon.svg',
alt: 'Chat2DB',
width:'80px'
},
items: [
{
label: '首页',
href: '/',
},
{
type: 'doc',
docId: 'index',
label: '文档',
position: 'left',
className: 'new-badge',
},
{
label: '资料',
type: 'dropdown',
className: 'dyte-dropdown resources-dropdown',
items: [
{
type: 'html',
value: resourcesHTML,
className: 'dyte-dropdown',
},
],
},
{
label: '下载',
to: "/docs/guides/download"
},
{
type: 'doc',
docId: 'support',
label: '联系我们',
position: 'left',
docsPluginId: 'community',
},
{
label: 'Github',
to: 'https://github.com/chat2db/Chat2DB',
},
],
},
colorMode: {
respectPrefersColorScheme: true,
},
docs: {
sidebar: {
hideable: true,
},
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: [
'dart',
'ruby',
'groovy',
'kotlin',
'java',
'swift',
'objectivec',
],
magicComments: [
{
className: 'theme-code-block-highlighted-line',
line: 'highlight-next-line',
block: { start: 'highlight-start', end: 'highlight-end' },
},
{
className: 'code-block-error-line',
line: 'highlight-next-line-error',
},
],
},
metadata: [
{
name: 'keywords',
content:
'chat2DB, MySQL, Oracle, 数据库管理工具, 数据库连接, SQL Server, chat2db, chat2db开源, chat2db开源文档, chat2db开源教程, chat2db开源安装, chat2db开源下载, chat2db开源安装教程, chat2db开源安装文档, chat2db开源安装手册, chat2db开源安装指南, chat2db开源安装说明, chat2db开源安装帮助, chat2db开源安装步骤, chat2db开源安装配置, chat2db开源安装环境, chat2db开源安装要求',
},
{
name: 'description',
content: 'Chat2DB开源版文档',
},
],
}),
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve('swc-loader'),
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
target: 'es2017',
},
module: {
type: isServer ? 'commonjs' : 'es6',
},
},
}),
},
};
module.exports = config;