forked from tursodatabase/turso-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
308 lines (286 loc) · 9.44 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
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
307
308
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
/** @type {import('@docusaurus/plugin-content-docs').Options} */
const homePluginOptions = {
id: 'home',
path: 'home',
routeBasePath: '/',
sidebarPath: require.resolve('./home/sidebars.js'),
}
/** @type {import('@docusaurus/plugin-content-docs').Options} */
const tutorialsPluginOptions = {
id: 'tutorials',
path: 'tutorials',
routeBasePath: 'tutorials',
sidebarPath: require.resolve('./tutorials/sidebars.js'),
}
/** @type {import('@docusaurus/plugin-content-docs').Options} */
const referencePluginOptions = {
id: 'reference',
path: 'reference',
routeBasePath: 'reference',
sidebarPath: require.resolve('./reference/sidebars.js'),
}
/** @type {import('@docusaurus/plugin-content-docs').Options} */
const libsqlPluginOptions = {
id: 'libsql',
path: 'libsql',
routeBasePath: 'libsql',
sidebarPath: require.resolve('./libsql/sidebars.js'),
}
/** @type {import('@docusaurus/theme-common').UserThemeConfig} */
const themeConfig = {
// Replace with your project's social card
// image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'Turso docs',
logo: {
alt: 'Turso logo',
src: 'img/turso.png',
},
items: [
{
type: 'doc',
docsPluginId: 'home',
docId: 'index',
label: 'Home',
position: 'left',
},
{
type: 'doc',
docsPluginId: 'tutorials',
docId: 'index',
label: 'Tutorials',
position: 'left',
},
{
type: 'doc',
docsPluginId: 'reference',
docId: 'index',
label: 'Reference',
position: 'left',
},
{
type: 'doc',
docsPluginId: 'libsql',
docId: 'index',
label: 'libSQL',
position: 'left',
},
{
href: 'https://turso.tech',
label: 'Website',
position: 'right',
},
{
href: 'https://turso.tech/app',
label: 'Dashboard',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'Turso logo',
src: 'img/turso.svg',
},
links: [
{
title: 'Turso: SQLite for the Edge',
items: [
{
html: `
<a href="https://api.turso.tech/?webui=true&type=signup" target="_blank" rel="noreferrer noopener" aria-label="Turso Sign Up">
<div class="footer__button signUp">
<p>Sign Up</p>
<svg width="16" height="16" viewBox="0 0 18 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M17.0303 6.28033C17.3232 5.98744 17.3232 5.51256 17.0303 5.21967L12.2574 0.4467C11.9645 0.153807 11.4896 0.153807 11.1967 0.4467C10.9038 0.739593 10.9038 1.21447 11.1967 1.50736L15.4393 5.75L11.1967 9.99264C10.9038 10.2855 10.9038 10.7604 11.1967 11.0533C11.4896 11.3462 11.9645 11.3462 12.2574 11.0533L17.0303 6.28033ZM0.5 6.5L16.5 6.5L16.5 5L0.5 5L0.5 6.5Z"
fill="black"
/>
</svg>
</div>
</a>
`,
},
{
html: `
<a href="https://github.com/libsql/libsql" target="_blank" rel="noreferrer noopener" aria-label="LibSQL Github repo">
<div class="footer__button github">
<p>Star Our Repo</p>
<svg width="16" height="16" viewBox="0 0 18 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M17.0303 6.28033C17.3232 5.98744 17.3232 5.51256 17.0303 5.21967L12.2574 0.4467C11.9645 0.153807 11.4896 0.153807 11.1967 0.4467C10.9038 0.739593 10.9038 1.21447 11.1967 1.50736L15.4393 5.75L11.1967 9.99264C10.9038 10.2855 10.9038 10.7604 11.1967 11.0533C11.4896 11.3462 11.9645 11.3462 12.2574 11.0533L17.0303 6.28033ZM0.5 6.5L16.5 6.5L16.5 5L0.5 5L0.5 6.5Z"
fill="white"
/>
</svg>
</div>
<!-- tracking pixel -->
<img style="display: block" referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=a20ba3e6-4dfe-46d1-8e1b-6ea070776d14" />
</a>
`,
},
]
},
{
title: 'Company',
items: [
{
label: 'About',
href: 'https://turso.tech/about-us',
},
{
label: 'Investors',
href: 'https://turso.tech/investors',
},
{
label: 'Blog',
href: 'https://blog.turso.tech',
},
],
},
{
title: 'Community',
items: [
// {
// label: 'Stack Overflow',
// href: 'https://stackoverflow.com/questions/tagged/turso',
// },
{
label: 'Turso Discord',
href: 'https://discord.com/invite/4B5D7hYwub',
},
{
label: 'libSQL Discord',
href: 'https://discord.gg/VzbXemj6Rg',
},
{
label: 'Follow us on Twitter',
href: 'https://twitter.com/tursodatabase',
},
{
label: 'Schedule a Zoom',
href: 'https://calendly.com/d/gt7-bfd-83n/meet-with-chiselstrike',
},
],
},
{
title: 'Open Source',
items: [
{
label: 'Turso GitHub',
href: 'https://github.com/tursodatabase/',
},
{
label: 'Turso extended GitHub',
href: 'https://github.com/turso-extended/',
},
{
label: 'libSQL GitHub',
href: 'http://github.com/tursodatabase/libsql',
},
],
},
{
title: 'Legal',
items: [
{
label: 'Privacy Policy',
href: 'https://turso.tech/privacy-policy',
},
{
label: 'Terms of Use',
href: 'https://turso.tech/terms-of-use',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Turso, Inc. Built with Docusaurus.`,
},
prism: {
// @ts-ignore
theme: lightCodeTheme,
// @ts-ignore
darkTheme: darkCodeTheme,
additionalLanguages: ['rust', 'toml'],
},
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
// @ts-ignore
algolia: {
// The application ID provided by Algolia
appId: 'EEBD8P3V4D',
// Public API key: it is safe to commit it
apiKey: 'da17bdeb96dabdb6db1643b86f907595',
indexName: 'turso',
}
};
/** @type {import('@docusaurus/theme-classic').Options} */
const themeOptions = {
customCss: require.resolve('./src/css/custom.css'),
}
/** @type {import('@docusaurus/plugin-client-redirects').Options} */
const redirectOptions = {
redirects: [
// Required with move of client SDK docs to libsql collection
{ from: '/reference/client-access', to: '/libsql/client-access' },
{ from: '/reference/client-access/go-sdk', to: '/libsql/client-access/go-sdk' },
{ from: '/reference/client-access/javascript-typescript-sdk', to: '/libsql/client-access/javascript-typescript-sdk' },
{ from: '/reference/client-access/python-sdk', to: '/libsql/client-access/python-sdk' },
{ from: '/reference/client-access/rust-sdk', to: '/libsql/client-access/rust-sdk' },
// CLI change with placement groups
{ from: '/tutorials/get-started-turso-cli/step-05-create-use-replica', to: '/tutorials/get-started-turso-cli/step-05-replicate-database-another-location' },
],
}
/** @type {import('@docusaurus/plugin-google-gtag').Options} */
const gtagOptions = {
trackingID: 'G-YMMQC402S1',
}
/** @type {import('@docusaurus/plugin-sitemap').Options} */
const sitemapOptions = {
// @ts-ignore
changefreq: 'daily',
}
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Turso',
tagline: 'The edge database based on libSQL',
favicon: 'img/favicon.ico',
themes: ['@docusaurus/theme-search-algolia'],
// Set the production url of your site here
url: 'https://docs.turso.tech',
// 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: 'facebook', // Usually your GitHub org/user name.
// projectName: 'docusaurus', // Usually your repo name.
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
// Even if you don't use internalization, 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: 'en',
locales: ['en'],
},
themeConfig: themeConfig,
plugins: [
[ 'content-docs', homePluginOptions ],
[ 'content-docs', tutorialsPluginOptions ],
[ 'content-docs', referencePluginOptions ],
[ 'content-docs', libsqlPluginOptions ],
[ '@docusaurus/theme-classic', themeOptions ],
[ '@docusaurus/plugin-client-redirects', redirectOptions ],
// [ '@docusaurus/plugin-google-analytics', gaOptions ],
[ '@docusaurus/plugin-google-gtag', gtagOptions ],
[ '@docusaurus/plugin-sitemap', sitemapOptions ],
],
};
module.exports = config;