Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
232 lines (217 loc) · 8.47 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
232 lines (217 loc) · 8.47 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
// Wrapper SDKs share one layout: an installation page and a privacy section.
const wrapperSdks = ['cordova', 'dotnet', 'flutter', 'kmp', 'react_native', 'unity', 'xamarin'];
const config: Config = {
title: 'Bugsee',
tagline: 'Documentation',
favicon: 'img/favicon.svg',
future: {
v4: true,
},
url: 'https://docs.bugsee.com',
baseUrl: '/',
trailingSlash: true,
// Fail the build (and the PR check) on a dead internal link or #anchor instead of warning:
// with 'warn' a broken /sdk/... link reached production unnoticed. Old URLs that must keep working
// belong in the client-redirects list below, not in content.
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
markdown: {
format: 'detect',
},
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
headTags: [
{ tagName: 'link', attributes: { rel: 'preconnect', href: 'https://app.bugsee.com' } },
{ tagName: 'link', attributes: { rel: 'preconnect', href: 'https://fonts.googleapis.com' } },
{ tagName: 'link', attributes: { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: 'anonymous' } },
{ tagName: 'link', attributes: { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap' } },
{ tagName: 'meta', attributes: { name: 'google-site-verification', content: 'pSQYyObzOo2o2ch9t0rRUGMYzIsh7AfP50AK0PRVw5Q' } },
],
scripts: [
{
src: 'https://embed.tawk.to/620e8c80a34c24564126d396/1fs4d9lsb',
async: true,
charset: 'UTF-8',
crossorigin: '*',
},
],
clientModules: [
'./src/clientModules/sessionSync.js',
'./src/clientModules/tokenReplacer.js',
'./src/clientModules/mobileTable.js',
'./src/clientModules/chatLink.js',
'./src/clientModules/aiPageActions.js',
],
themes: [
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
docsRouteBasePath: '/',
indexBlog: false,
},
],
],
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
// Section roots have no page of their own; send them to the first page.
{ from: '/sdk/ios', to: '/sdk/ios/installation/' },
{ from: '/sdk/ios/v7', to: '/sdk/ios/v7/installation/' },
{ from: '/sdk/ios/builds', to: '/sdk/ios/builds/overview/' },
{ from: '/sdk/ios/privacy', to: '/sdk/ios/privacy/overview/' },
{ from: '/sdk/android', to: '/sdk/android/overview/' },
{ from: '/sdk/android/manual', to: '/sdk/android/manual/bug-reporting/' },
{ from: '/sdk/android/privacy', to: '/sdk/android/privacy/overview/' },
{ from: '/sdk/android/v6', to: '/sdk/android/v6/installation/' },
{ from: '/sdk/android/v6/privacy', to: '/sdk/android/v6/privacy/overview/' },
...wrapperSdks.flatMap((sdk) => [
{ from: `/sdk/${sdk}`, to: `/sdk/${sdk}/installation/` },
{ from: `/sdk/${sdk}/privacy`, to: `/sdk/${sdk}/privacy/overview/` },
]),
// Hyphenated spelling of the React Native section root (deep pages are covered by createRedirects).
{ from: '/sdk/react-native', to: '/sdk/react_native/installation/' },
{ from: '/sdk/react-native/privacy', to: '/sdk/react_native/privacy/overview/' },
// Android pages that were split or renamed.
{ from: '/sdk/android/custom', to: '/sdk/android/events-and-traces/' },
{ from: '/sdk/android/crashes', to: '/sdk/android/issue-detection/crashes/' },
{ from: '/sdk/android/gradle-plugin-releases', to: '/sdk/android/gradle-plugin/releases/' },
{ from: '/sdk/android/v7', to: '/sdk/android/overview/' },
{ from: '/sdk/android/v7/privacy', to: '/sdk/android/privacy/overview/' },
{ from: '/sdk/android/v7/custom', to: '/sdk/android/events-and-traces/' },
{ from: '/sdk/android/v7/crashes', to: '/sdk/android/issue-detection/crashes/' },
{ from: '/sdk/android/v7/detection', to: '/sdk/android/issue-detection/' },
{ from: '/sdk/android/v7/extensions', to: '/sdk/android/extensibility/bugsee-extensions/' },
{ from: '/sdk/android/v7/manual', to: '/sdk/android/manual/bug-reporting/' },
],
// Android 7.x lived under /sdk/android/v7/ until it became the default;
// every current Android page keeps answering at its old v7 address.
//
// The React Native docs live under /sdk/react_native/; the hyphenated spelling is
// what people (and the other platform URLs) naturally try.
createRedirects(existingPath: string) {
if (existingPath.startsWith('/sdk/android/') && !existingPath.startsWith('/sdk/android/v6/')) {
return existingPath.replace('/sdk/android/', '/sdk/android/v7/');
}
if (existingPath.startsWith('/sdk/react_native/')) {
return existingPath.replace('/sdk/react_native/', '/sdk/react-native/');
}
return undefined;
},
},
],
],
presets: [
[
'classic',
{
docs: {
routeBasePath: '/',
sidebarPath: './sidebars.ts',
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: 'Docs',
logo: {
alt: 'Bugsee Logo',
src: 'img/bugsee_logo.svg',
href: '/',
target: '_self',
},
style: 'dark',
items: [
{ to: '/cli/', label: 'CLI', position: 'left' },
{ href: 'https://bugsee.com/pricing/', label: 'Pricing', position: 'left' },
{ href: 'https://bugsee.com/faq/', label: 'FAQ', position: 'left' },
{ href: 'https://bugsee.com/blog/is-bugsee-any-good/', label: 'Is Bugsee Any Good?', position: 'left' },
{
href: 'https://app.bugsee.com/#/login?as=demo',
label: 'Live demo',
position: 'right',
},
{
href: 'https://app.bugsee.com/#/signin',
label: 'Login',
position: 'right',
},
{
href: 'https://app.bugsee.com/#/signup',
label: 'Free Sign Up',
position: 'right',
className: 'navbar-signup-link',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Products',
items: [
{ label: 'Bugsee for iOS', to: '/sdk/ios/installation/' },
{ label: 'Bugsee for Android', to: '/sdk/android/installation/' },
{ label: 'Bugsee for Cordova', to: '/sdk/cordova/installation/' },
{ label: 'Bugsee for React Native', to: '/sdk/react_native/installation/' },
{ label: 'Bugsee for Xamarin', to: '/sdk/xamarin/installation/' },
{ label: 'Bugsee for .NET/MAUI', to: '/sdk/dotnet/installation/' },
{ label: 'Bugsee for Flutter', to: '/sdk/flutter/installation/' },
{ label: 'Bugsee for Unity', to: '/sdk/unity/installation/' },
],
},
{
title: 'Learn',
items: [
{ label: 'About', href: 'https://bugsee.com/about/' },
{ label: 'FAQ', href: 'https://bugsee.com/faq/' },
{ label: 'Documentation', to: '/' },
{ label: 'Blog', href: 'https://bugsee.com/blog/' },
],
},
{
title: 'Contact',
items: [
{ label: 'Email', href: 'mailto:support@bugsee.com' },
{
label: 'Chat',
href: 'https://bugsee.com/',
className: 'bs-toggle-chat',
},
],
},
{
title: 'Legal',
items: [
{ label: 'Privacy Policy', href: 'https://bugsee.com/privacy/' },
{ label: 'Terms of Service', href: 'https://bugsee.com/tos/' },
],
},
],
copyright: `\u00A9 ${new Date().getFullYear()} Bugsee Inc | All rights reserved`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['bash', 'java', 'kotlin', 'swift', 'objectivec', 'csharp', 'dart', 'groovy', 'json', 'yaml', 'ruby', 'xml-doc'],
},
} satisfies Preset.ThemeConfig,
};
export default config;