-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocusaurus.config.js
213 lines (207 loc) · 6.54 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
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const { globalConfig, i18nConfig } = require('./config');
const isDeployPreview = process.env.CONTEXT === "deploy-preview";
const isDeveloping = process.env.NODE_ENV === "development";
// const isProductionDeployment = process.env.CONTEXT === "production";
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'ASEAN BTE',
tagline: 'We are building southeast asia in Minecraft 1:1 scale!',
baseUrl: '/',
onBrokenLinks: 'ignore',
onBrokenMarkdownLinks: 'warn',
favicon: 'media/icons/aseanbte_logo.png',
organizationName: 'ASEAN-Build-The-Earth',
projectName: 'ASEAN-Docs',
url: globalConfig.siteUrl,
clientModules: [globalConfig.globalModule],
customFields: globalConfig,
trailingSlash: false,
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: 'docs.intro',
routeBasePath: "intro", // change default "doc/" root path
sidebarPath: require.resolve('./sidebars.intro.js'),
editUrl: ({ locale, docPath }) => {
if (locale !== 'en') {
return `${globalConfig.baseGithubUrl}/ASEAN-Docs/blob/main/i18n/${locale}/docusaurus-plugin-content-docs/current/${docPath}`;
}
return `${globalConfig.baseGithubUrl}/ASEAN-Docs/tree/main/docs.intro/${docPath}`;
},
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
gtag: {
trackingID: globalConfig.googleGtag,
anonymizeIP: true,
},
blog: false,
/* no blog
blog: {
showReadingTime: true,
editUrl:
'https://github.com/ASEAN-Build-The-Earth/ASEAN-Docs/tree/main/',
},
*/
theme: {
customCss: globalConfig.globalStyle,
},
/* http://localhost:3000/__docusaurus/debug */
debug: isDeveloping? true : false,
}),
],
],
plugins: [
[ /* Builder guide page */
'content-docs',
/** @type {import('@docusaurus/plugin-content-docs').Options} */
({
id: 'builder-guide',
path: 'docs.builder-guide',
routeBasePath: 'guide',
editUrl: ({locale, docPath}) => {
if (locale !== 'en') {
return `${globalConfig.baseGithubUrl}/ASEAN-Docs/tree/main/docs.builder-guide/${locale}/docusaurus-plugin-content-docs-builder-guide/current/${docPath}`;
}
return `${globalConfig.baseGithubUrl}/ASEAN-Docs/tree/main/docs.builder-guide/${docPath}`;
},
sidebarPath: require.resolve('./sidebars.builder-guide.js'),
showLastUpdateAuthor: true,
showLastUpdateTime: true,
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
(
{
colorMode: { defaultMode: "dark", },
image: "media/icons/aseanbte_full_logo.jpg", //meta og image
metadata: [{name: 'theme-color', content: '#ffc561'}],
docs: {
sidebar: {
autoCollapseCategories: true,
hideable: true,
},
},
navbar: {
title: 'ASEAN BTE',
logo: {
alt: 'ASEAN BTE',
src: 'media/icons/aseanbte_logo.gif',
},
items: [
{
type: 'doc',
docId: 'get-started',
position: 'left',
label: 'Get Started',
},
{
to: 'guide/builder-guide',
position: 'left',
label: 'Builder Guide',
},
{
to: 'support',
label: 'Support Us',
position: 'left'
},
{
href: globalConfig.discordInviteLink,
label: 'Discord',
position: 'right',
},
{
type: 'localeDropdown',
position: 'right',
dropdownItemsBefore: [
{ // [TODO]: replace this href to our google doc translate site
href: `${globalConfig.baseGithubUrl}/ASEAN-Docs#translation`,
label: 'Help Us Translate',
},
],
},
],
},
footer: {
style: 'dark',
copyright: `Copyright © ${new Date().getFullYear()} Association of Southeast Asian Nation Build The Earth.`,
links: [
{
title: 'Docs',
items: [
{
label: 'Get Started',
to: 'intro/get-started',
},
{
label: 'Builder Guide',
to: 'guide/builder-guide',
},
],
},
{
title: 'Discord Community',
items: [
{
label: 'BuildTheEarth.net',
href: 'https://discord.gg/buildtheearth',
},
{
label: 'BuildTheEarth.Asia',
href: 'https://discord.gg/R5dfd4Fc8b'
},
{
label: 'BuildTheEarth ASEAN',
href: globalConfig.discordInviteLink,
},
],
},
{
title: 'More',
items: [
{
label: 'Support Us',
to: '/support',
},
{
label: 'GitHub',
href: globalConfig.baseGithubUrl,
},
{
label: 'BuildTheEarth Website',
href: 'https://buildtheearth.net/'
}
],
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
// extra annoucement
// announcementBar: {
// id: 'annouce-translation',
// content:
// '<strong>Make a ticket in our discord server and message us your email to gain access to our google spreadsheet and help us translate this site. (you can preview it <a href="https://docs.google.com/spreadsheets/d/1SMr3F7tv2HIj4bqk0YDECXhJhLZVJPfs12SxFEVHm9c/edit?usp=sharing">here</a>)</strong>',
// backgroundColor: '#99ffcc',
// textColor: '#091E42',
// isCloseable: false,
// },
}
),
i18n: {
defaultLocale: i18nConfig.defaultLocale,
locales: isDeployPreview? [i18nConfig.defaultLocale] : i18nConfig.registeredLocales,
localeConfigs: i18nConfig.localeConfigs
},
scripts: globalConfig.globalScript,
};
module.exports = config;