Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
351 lines (346 loc) · 12.3 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
351 lines (346 loc) · 12.3 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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
// Load default export (must be a function)
const unwrapJsx = require('./src/plugins/unwrap-jsx').default;
if (typeof unwrapJsx !== 'function') {
throw new Error('unwrapJsx plugin is not a function');
}
// Enabling PR previews
// Docusaurus will read the BASE_URL env var set in the CI.
// We fall back to '/' for local development.
let siteBaseUrl = process.env.BASE_URL || '/';
// Product areas that get their own /<dir>/llms.txt and /<dir>/llms-full.txt.
const llmsSections = [
{
dir: 'mobile-apps',
title: 'Mobile App Testing',
patterns: ['docs/mobile-apps.md', 'docs/mobile-apps/**'],
},
{
dir: 'web-apps',
title: 'Web App Testing',
patterns: ['docs/web-apps.md', 'docs/web-apps/**'],
},
{
dir: 'live-testing',
title: 'Live Testing',
patterns: [
'docs/mobile-apps/live-testing/**',
'docs/web-apps/live-testing/**',
],
},
{
dir: 'secure-connections',
title: 'Sauce Connect and Secure Connections',
patterns: ['docs/secure-connections.md', 'docs/secure-connections/**'],
},
{
dir: 'dev',
title: 'APIs, CLI and Developer Reference',
patterns: ['docs/dev.md', 'docs/dev/**'],
},
{
dir: 'error-reporting',
title: 'Error Reporting',
patterns: ['docs/error-reporting/**'],
},
{
dir: 'testfairy',
title: 'App Distribution',
patterns: ['docs/testfairy/**'],
},
{
dir: 'visual-testing',
title: 'Visual Testing',
patterns: ['docs/visual-testing.md', 'docs/visual-testing/**'],
},
{
dir: 'sauce-ai',
title: 'Sauce AI',
patterns: ['docs/sauce-ai.md', 'docs/sauce-ai/**'],
},
];
const docusaurusConfig = {
title: 'Sauce Labs Documentation',
tagline: 'Test all the things.',
url: 'https://docs.saucelabs.com',
noIndex: process.env.NO_INDEX,
trailingSlash: true,
baseUrl: siteBaseUrl,
onBrokenAnchors: 'throw',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
organizationName: 'saucelabs',
projectName: 'sauce-docs',
// TODO: I don't think google-site-verification is working at all, confirm with P.O.
customFields: {
headTags: [
{
tagName: 'meta',
attributes: {
name: 'google-site-verification',
content: 'googlee2afebcc27f8c950.html',
},
},
],
},
headTags: [
{
tagName: 'link',
attributes: {
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/img/favicon-16x16.png?v=2',
},
},
{
tagName: 'link',
attributes: {
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/img/favicon-32x32.png?v=2',
},
},
],
scripts: [
'/scripts/hide.js',
// Need Help? button
{
src: 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js',
type: 'text/javascript',
charset: 'UTF-8',
'data-domain-script': '9e4c4ce3-8349-4030-9de7-0b1d368edfce',
},
{
src: 'https://solve-widget.forethought.ai/embed.js',
type: 'application/javascript',
'data-api-key': '1f0243be-fd74-4205-bbff-cf72bc3c96b3',
'data-ft-location': 'docs',
},
],
themeConfig: {
prism: {
additionalLanguages: [
'java',
'ruby',
'csharp',
'bash',
'powershell',
'python',
],
},
/* Dark and Light Mode Config */
colorMode: {
defaultMode: 'light',
// Hides the switch in the navbar
disableSwitch: false,
respectPrefersColorScheme: false,
},
navbar: {
title: null,
hideOnScroll: false,
logo: {
alt: 'Sauce Labs logo',
src: '/img/sl-logo-horizontal-color-dark.svg',
srcDark: '/img/sl-logo-horizontal-color-neutral.svg',
},
items: [
{
label: 'Docs',
position: 'left',
to: '/overview',
},
{
label: 'Sauce AI',
position: 'left',
to: '/sauce-ai',
},
{
label: 'API',
position: 'left',
to: '/dev/api',
},
{
label: 'CLI',
position: 'left',
to: '/dev/cli',
},
{
label: 'Visual',
position: 'left',
to: '/visual-testing',
},
{
label: 'App Distribution',
position: 'left',
to: '/testfairy',
},
{
label: 'Error Reporting',
position: 'left',
to: '/error-reporting/getting-started',
},
{
label: 'Real Device Access API',
position: 'left',
to: '/dev/api/real-device-access',
},
],
},
/* this is a swizzled component, see inside theme folder */
footer: {
logo: {
alt: 'Sauce Logo',
src: '/img/sl-logo-horizontal-color-neutral.svg',
href: 'https://saucelabs.com',
},
style: 'light',
links: [],
copyright: `© ${new Date().getFullYear()} Sauce Labs, Inc. SAUCE and SAUCE LABS are registered trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
blog: false,
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
path: 'docs',
breadcrumbs: true,
routeBasePath: '/',
editUrl:
'https://github.com/saucelabs/sauce-docs/edit/main/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
remarkPlugins: [unwrapJsx],
},
googleAnalytics: {
trackingID: 'UA-6735579-1',
},
// announcementBar: {
// id: 'site_announcement', // Any value that will identify this message.
// content:
// '<button class="announcementBarBadge">NEW</button> Our improved documentation is here! <a target="_blank" rel="noopener noreferrer" href="mailto:docsfeedback@saucelabs.com"><button class="announcementBar">Tell us what you think</button></a>',
// backgroundColor: '#0D65BE', // Defaults to `#fff`.
// textColor: '#F0F0F0', // Defaults to `#000`.
// isCloseable: true, // Defaults to `true`.
// },
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
themes: ['docusaurus-theme-github-codeblock'],
plugins: [
[
// Generates /llms.txt, /llms-full.txt, per-page .md files and
// per-product-area files for AI tools at build time.
'docusaurus-plugin-llms',
{
title: 'Sauce Labs Documentation',
description:
'Sauce Labs is a cloud-based continuous testing platform for web and mobile apps, offering automated and live testing on real devices, emulators, simulators and desktop browsers, plus visual testing, error reporting and app distribution.',
docsDir: [{ path: 'docs', routeBasePath: '/' }],
ignoreFiles: [
'docs/contributing.md',
'docs/contributing/**',
'docs/templates/**',
'docs/assets/**',
'**/*.jsx',
],
// Mirrors the top-level sidebar order.
includeOrder: [
'docs/overview.md',
'docs/sauce-basics.md',
'docs/basics/**',
'docs/secure-connections.md',
'docs/secure-connections/**',
'docs/testfairy/**',
'docs/mobile-apps.md',
'docs/mobile-apps/**',
'docs/web-apps.md',
'docs/web-apps/**',
'docs/ci.md',
'docs/ci/**',
'docs/test-results.md',
'docs/test-results/**',
'docs/insights.md',
'docs/insights/**',
'docs/sauce-ai.md',
'docs/sauce-ai/**',
'docs/ide-plugins.md',
'docs/ide-plugins/**',
'docs/performance.md',
'docs/performance/**',
'docs/visual-testing.md',
'docs/visual-testing/**',
'docs/dev.md',
'docs/dev/**',
'docs/error-reporting/**',
],
generateMarkdownFiles: true,
excludeImports: true,
removeDuplicateHeadings: true,
customLLMFiles: llmsSections.flatMap(
({ dir, title, patterns }) => [
{
filename: `${dir}/llms.txt`,
includePatterns: patterns,
fullContent: false,
title: `Sauce Labs Documentation: ${title}`,
},
{
filename: `${dir}/llms-full.txt`,
includePatterns: patterns,
fullContent: true,
title: `Sauce Labs Documentation: ${title}`,
},
]
),
},
],
[
'@scalar/docusaurus',
{
id: 'real-device-access-api',
label: 'Real Device Access API',
route: '/real-device-access-api',
// Nav link is provided manually in `navbar.items` above so it
// points at the embedded Scalar page (/dev/api/real-device-access).
showNavLink: false,
configuration: {
hideClientButton: true,
hideTestRequestButton: true,
hideSearch: true,
defaultOpenAllTags: true,
layout: 'classic',
sources: [
{
// This title will appear in the top left dropdown within Scalar API doc.
title: 'Real Device Access API',
url: `${siteBaseUrl}oas/real-device-access-api-spec.yaml`,
},
{
// AsyncAPI description of the two WebSockets.
// Keep in sync with docs/dev/api/real-device-access.mdx.
title: 'Real Device Access API — WebSockets',
url: `${siteBaseUrl}oas/real-device-access-api-websockets.yaml`,
},
],
},
},
],
],
};
if (!process.env.SAUCE_DOCS_DEV) {
docusaurusConfig.themeConfig.algolia = {
appId: 'RO95H65NEO',
apiKey: '3a5924ec9fa1457b4999d8dcfc382c2d',
indexName: 'Sauce Docs Crawler',
contextualSearch: false,
};
}
module.exports = docusaurusConfig;