Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
212 lines (206 loc) · 5.67 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
212 lines (206 loc) · 5.67 KB
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
// @ts-check
import {
themes
} from 'prism-react-renderer';
import {SITE_URL, BASE_URL} from './plugins/markdown-export/urls.js';
import {shipItAnnouncementBar} from './plugins/ship-it-banner/index.js';
import {
LANDING_TITLE,
LANDING_DESCRIPTION,
APP_STUDIO_URL,
RELIC_URL,
API_REFERENCE_URL,
} from './src/landing/metadata.js';
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Serverpod',
tagline: 'The missing server for Flutter',
url: SITE_URL,
baseUrl: BASE_URL,
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
favicon: 'img/favicon.png',
organizationName: 'serverpod',
projectName: 'serverpod.github.io',
trailingSlash: false,
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: 'throw',
}
},
themes: ['@docusaurus/theme-mermaid'],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/serverpod/serverpod_docs/tree/main/',
breadcrumbs: false,
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-0EYLJMP04H',
anonymizeIP: true,
},
googleTagManager: {
containerId: 'GTM-WG5VRRKX',
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
respectPrefersColorScheme: true,
disableSwitch: true,
},
// Ship it with Serverpod banner. Switch, copy, and dates live in
// plugins/ship-it-banner/index.js.
announcementBar: shipItAnnouncementBar(),
navbar: {
logo: {
alt: 'Serverpod Logo',
src: 'img/logo-horizontal.svg',
srcDark: 'img/logo-horizontal-dark.svg',
href: 'https://serverpod.dev',
target: '_self',
},
// The same navbar shows on every page. The "Docs" link beside the
// logo is added in src/theme/Navbar/Logo, and the Framework version
// picker lives in the docs sidebar.
items: [{
href: APP_STUDIO_URL,
label: 'App Studio',
target: '_self',
position: 'right',
},
// `doc` items are highlighted on every page of their docs. Outside
// the Framework docs, the Framework link opens the version the
// reader last picked, or the latest version.
{
type: 'doc',
docId: 'index',
label: 'Serverpod Framework',
position: 'right',
},
{
type: 'doc',
docId: 'index',
docsPluginId: 'cloud',
label: 'Serverpod Cloud',
position: 'right',
},
{
href: RELIC_URL,
label: 'Relic',
target: '_self',
position: 'right',
},
{
href: API_REFERENCE_URL,
label: 'API reference',
target: '_self',
position: 'right',
},
{
type: 'search',
position: 'right',
},
],
},
algolia: {
// The search-only `apiKey` is safe to commit.
appId: '6LZRX3JBXY',
indexName: 'Serverpod docs',
apiKey: '2f0125e1ff6fe9469eac332ea47423d6',
contextualSearch: true,
},
footer: {
copyright: `Copyright © ${new Date().getFullYear()} Serverpod authors.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['dart', 'bash'],
},
}),
scripts: [{
src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
'data-website-id': '9ae02024-c2cf-4f58-b2d9-7ca3961dc1ef',
'data-project-name': 'Serverpod',
'data-project-color': '#020F24',
'data-project-logo': 'https://avatars.githubusercontent.com/u/48181558?s=200&v=4',
async: true,
}, ],
plugins: [
[
'./plugins/open-graph-images',
{
// Social card for the landing page, which is not a doc.
extraCards: [{title: LANDING_TITLE, description: LANDING_DESCRIPTION}],
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'cloud',
path: 'cloud_docs',
routeBasePath: 'cloud',
sidebarPath: require.resolve('./sidebarsCloud.js'),
editUrl: 'https://github.com/serverpod/serverpod_cloud/tree/main/docs/docs/',
breadcrumbs: false,
},
],
'./plugins/markdown-export',
'./plugins/ship-it-banner',
[
'docusaurus-plugin-snipsync',
{
origins: [{
files: {
pattern: '../serverpod/examples/**/*.{dart,yaml}',
},
},
{
owner: 'serverpod',
repo: 'serverpod',
files: {
pattern: 'examples/**/*.{dart,yaml}',
},
},
{
owner: 'serverpod',
repo: 'serverpod',
ref: 'feat/add-getting-started-examples',
files: {
pattern: 'examples/**/*.{dart,yaml}',
},
},
],
targets: ['docs'],
features: {
enable_source_link: false,
allowed_target_extensions: ['.md', '.mdx'],
enable_code_block: true,
},
},
],
[
'@docusaurus/plugin-client-redirects',
{
redirects: require('./redirects'),
},
],
],
};
module.exports = config;