1
1
import { themes as prismThemes } from 'prism-react-renderer' ;
2
2
import type { Config } from '@docusaurus/types' ;
3
3
import type * as Preset from '@docusaurus/preset-classic' ;
4
+ import { announcementBarContent , ASKBEND_URL , siteConfig , tagline } from './site-config' ;
5
+ import siteRedirects from './site-redirects' ;
6
+
4
7
5
8
const { site } = process . env ;
6
9
const isCN = ( site || "cn" ) === "cn" ;
7
10
const lang = isCN ? "zh" : "en" ;
8
11
9
- const homeLink = isCN ? "https://www.databend.cn" : "https://www.databend.com" ;
10
- const cloudLink = isCN ? "https://app.databend.cn" : "https://app.databend.com" ;
11
- const docsHomeLink = isCN
12
- ? "https://docs.databend.cn"
13
- : "https://docs.databend.com" ;
14
- const TwitterSvg =
15
- '<svg width="20" style="top: 5px; position: relative" height="20" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><g><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path></g></svg>' ;
16
-
17
12
const { site_env } = process . env ;
18
13
const isProduction = site_env === "production" ;
19
- const ASKBEND_URL = "https://ask.databend.com" ;
20
- const algolia = isCN
21
- ? {
22
- appId : "FUCSAUXK2Q" ,
23
- apiKey : "0f200c10999f19584ec9e31b5caa9065" ,
24
- indexName : "databend" ,
25
- contextualSearch : true
26
- }
27
- : {
28
- appId : "XA8ZCKIEYU" ,
29
- apiKey : "81e5ee11f82ed1c5de63ef7ea0551abf" ,
30
- indexName : "databend" ,
31
- contextualSearch : false
32
- } ;
33
14
34
15
const config : Config = {
35
16
title : "Databend" ,
36
17
staticDirectories : [ "static" , "./docs/public" ] ,
37
- tagline :
38
- "Databend - Your best alternative to Snowflake. Cost-effective and simple for massive-scale analytics." ,
39
- url : docsHomeLink ,
18
+ tagline,
19
+ url : siteConfig [ lang ] . docsHomeLink , // Your website URL
40
20
baseUrl : "/" ,
41
21
onBrokenAnchors : "ignore" ,
42
22
onBrokenLinks : "throw" ,
@@ -75,9 +55,9 @@ const config: Config = {
75
55
] ,
76
56
customFields : {
77
57
isChina : isCN ,
78
- docsHomeLink,
79
- homeLink,
80
- cloudLink,
58
+ docsHomeLink : siteConfig [ lang ] . docsHomeLink ,
59
+ homeLink : siteConfig [ lang ] . homeLink ,
60
+ cloudLink : siteConfig [ lang ] . cloudLink ,
81
61
blogTags : [ "weekly" , "databend" ] ,
82
62
askBendUrl : isProduction ? ASKBEND_URL : "" ,
83
63
} ,
@@ -109,7 +89,7 @@ const config: Config = {
109
89
// com: G-KYDJ7HV75X
110
90
// cn: G-M88HSQF3DK
111
91
// rs: G-WBQPTTG4ZG
112
- trackingID : isCN ? "G-M88HSQF3DK" : "G-KYDJ7HV75X" ,
92
+ trackingID : siteConfig [ lang ] . trackingID ,
113
93
anonymizeIP : true ,
114
94
} ,
115
95
} satisfies Preset . Options ,
@@ -209,32 +189,7 @@ const config: Config = {
209
189
[
210
190
'@docusaurus/plugin-client-redirects' ,
211
191
{
212
- redirects : [
213
- {
214
- from : '/' ,
215
- to : '/guides/'
216
- } ,
217
- {
218
- from : '/sql/sql-reference/table-engines/iceberg' ,
219
- to : '/guides/access-data-lake/iceberg/'
220
- } ,
221
- {
222
- from : '/sql/sql-functions/ai-functions/ai-cosine-distance' ,
223
- to : '/sql/sql-functions/vector-distance-functions/vector-cosine-distance/'
224
- } ,
225
- {
226
- from : '/guides/migrate/' ,
227
- to : '/tutorials/migrate/'
228
- } ,
229
- {
230
- from : '/guides/migrate/mysql' ,
231
- to : '/tutorials/migrate/migrating-from-mysql-with-db-archiver'
232
- } ,
233
- {
234
- from : '/guides/migrate/snowflake' ,
235
- to : '/tutorials/migrate/migrating-from-snowflake'
236
- }
237
- ] ,
192
+ redirects : siteRedirects ,
238
193
createRedirects ( existingPath ) {
239
194
if ( existingPath ?. includes ( '/developer/community/rfcs/' ) ) {
240
195
return existingPath . replace ( '/developer/community/rfcs/' , '/guides/community/rfcs/' ) ;
@@ -252,18 +207,18 @@ const config: Config = {
252
207
themeConfig : {
253
208
// Replace with your project's social card
254
209
image : "img/logo/logo-no-text.png" ,
255
- algolia,
210
+ algolia : siteConfig [ lang ] . algolia ,
256
211
mermaid : {
257
212
theme : { dark : 'dark' }
258
213
} ,
259
214
announcementBar : {
260
215
id : "announcementBar-2" , // Increment on change
261
- content : `⭐️ If you like Databend, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/datafuselabs/databend">GitHub</a> and follow us on <a target="_blank" rel="noopener noreferrer" href="https://x.com/DatabendLabs" >Twitter</a> ${ TwitterSvg } ` ,
216
+ content : announcementBarContent ,
262
217
} ,
263
218
navbar : {
264
219
title : "DOCUMENTATION" ,
265
220
logo : {
266
- href : homeLink ,
221
+ href : siteConfig [ lang ] . homeLink ,
267
222
target : "_blank" ,
268
223
srcDark : "img/logo-dark.svg" ,
269
224
src : "img/logo.svg" ,
@@ -330,15 +285,15 @@ const config: Config = {
330
285
} ,
331
286
{
332
287
label : "Downloads" ,
333
- to : `${ homeLink } /download/` ,
288
+ to : `${ siteConfig [ lang ] . homeLink } /download/` ,
334
289
} ,
335
290
{
336
291
label : "Developer" ,
337
292
to : "/developer/" ,
338
293
} ,
339
294
{
340
295
label : "Blog" ,
341
- to : `${ homeLink } /blog/` ,
296
+ to : `${ siteConfig [ lang ] . homeLink } /blog/` ,
342
297
} ,
343
298
] ,
344
299
} ,
@@ -350,13 +305,13 @@ const config: Config = {
350
305
href : "https://link.databend.com/join-slack" ,
351
306
} ,
352
307
{
353
- label : "Twitter " ,
308
+ label : "X " ,
354
309
href : "https://x.com/DatabendLabs" ,
355
310
} ,
356
311
] ,
357
312
} ,
358
313
] ,
359
- copyright : `Copyright © 2023 Datafuse Labs, Inc. Built with Docusaurus. <br><br> <img src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg">` ,
314
+ copyright : '@DatabendLabs' ,
360
315
} ,
361
316
prism : {
362
317
theme : prismThemes . github ,
0 commit comments