Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
395 lines (376 loc) · 16 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
395 lines (376 loc) · 16 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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const path = require("path");
const {
mdiRoutes,
mdiRobotOutline,
mdiEyeCheckOutline,
mdiConnection,
mdiShieldCheckOutline,
mdiScaleBalance,
mdiSchoolOutline,
mdiPuzzleOutline,
mdiAccountCheckOutline,
} = require("@mdi/js");
// Rich navbar dropdown rows: icon tile + title + one-line description.
const navRichItem = (title, desc, icon, badge) =>
`<span class="nav-rich"><span class="nav-rich-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="${icon}"/></svg></span><span class="nav-rich-text"><span class="nav-rich-title">${title}${badge ? `<span class="nav-new">${badge}</span>` : ""}</span><span class="nav-rich-desc">${desc}</span></span></span>`;
// /learn: learnHubLive (hub.live or t1.launched) gates the navbar "Learn" item;
// tutorials without their own page get a "coming soon + notify" route.
const { learnHubLive } = require("./src/data/learn-config");
const { tutorials, learnShowNew } = require("./src/data/learn-tutorials");
// The pathname the site is served under. Docusaurus prefixes the `favicon`
// field with this automatically, but not `headTags` hrefs -- those are emitted
// verbatim, so they have to interpolate it themselves.
const baseUrl = "/";
// Staging (website.wopee.io) and demo builds are copies of wopee.io: they carry
// noindex and point canonical, og:url and the sitemap at wopee.io. Only builds
// with WOPEE_SITE=production (the website-prod deploy) are indexable.
const isProductionSite = process.env.WOPEE_SITE === "production";
/** @type {import('@docusaurus/types').Config} */
const config = {
// Site title is appended to every page's <title> tag as "Page Title | <site title>".
// Kept short ("Wopee.io") so per-page titles can fit the descriptive context within
// Google's ~60-char SERP limit. Per-page Layout `title` props carry the keyword load
// (e.g. homepage: "AI Testing Agents for Web Apps").
title: "Wopee.io",
tagline:
"Boost your testing team. Elevate your quality & speed up release pace.",
favicon: "img/favicon.ico",
clientModules: [require.resolve("./src/clientModules/sharedConsent.mjs")],
// Docusaurus `favicon` emits one icon link (the 16/32/48 .ico). The rest of the
// set from the brand masters: SVG for sharp tabs, PNG sizes, the iOS icon and
// the web app manifest (192/512, any + maskable).
headTags: [
{
tagName: "link",
attributes: { rel: "icon", type: "image/svg+xml", href: `${baseUrl}img/favicon.svg` },
},
{
tagName: "link",
attributes: { rel: "icon", type: "image/png", sizes: "32x32", href: `${baseUrl}img/favicon-32.png` },
},
{
tagName: "link",
attributes: { rel: "icon", type: "image/png", sizes: "16x16", href: `${baseUrl}img/favicon-16.png` },
},
{
tagName: "link",
attributes: { rel: "apple-touch-icon", sizes: "180x180", href: `${baseUrl}img/apple-touch-icon.png` },
},
{
tagName: "link",
attributes: { rel: "manifest", href: `${baseUrl}manifest.webmanifest` },
},
],
url: "https://wopee.io",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "autonomous-testing", // Usually your GitHub org/user name.
projectName: "website", // Usually your repo name.
// projectName: "wopee.io", // Usually your repo name.
trailingSlash: true,
onBrokenLinks: "throw",
onBrokenAnchors: "warn",
markdown: {
hooks: {
onBrokenMarkdownLinks: "warn",
},
},
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
plugins: [
function MyAliasPlugin(_context, _options) {
return {
name: "my-alias-plugin",
configureWebpack() {
return {
resolve: {
alias: {
"@": path.join(__dirname, "src"),
},
},
module: {
// static/agent-setup/prompt.md is imported as plain text by /agent-setup/.
// An MDX-shaped rule with an include also keeps Docusaurus's MDX fallback loader off it.
rules: [
{
test: /\.mdx?$/i,
include: [path.join(__dirname, "static/agent-setup")],
type: "asset/source",
},
],
},
};
},
};
},
function learnComingSoonPlugin() {
return {
name: "learn-coming-soon",
async contentLoaded({ actions }) {
for (const t of tutorials.filter((x) => !x.hasPage)) {
actions.addRoute({
path: `${baseUrl}learn/${t.slug}/`,
component: "@site/src/components/learn/ComingSoonPage.tsx",
exact: true,
props: { slug: t.slug },
});
}
},
};
},
async function myTailwindPlugin(_context, _options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
function (_context, _options) {
return {
name: "custom-script-plugin",
injectHtmlTags() {
return {
bodyTags: [],
preBodyTags: [
{
tagName: "link",
attributes: {
rel: "preload",
href: "https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,600;0,800;1,400;1,600;1,800&display=swap",
as: "style",
onload: "this.onload=null;this.rel='stylesheet'",
},
},
],
// HubSpot tracking loads after the load event, once the page is idle.
postBodyTags: [
{
tagName: "script",
innerHTML: `(function(){function a(){if(document.getElementById("hs-script-loader"))return;var s=document.createElement("script");s.id="hs-script-loader";s.async=true;s.defer=true;s.src="//js-eu1.hs-scripts.com/139620033.js";document.body.appendChild(s)}function i(){"requestIdleCallback"in window?requestIdleCallback(a,{timeout:3000}):setTimeout(a,1500)}document.readyState==="complete"?i():window.addEventListener("load",i,{once:true})})();`,
},
],
};
},
};
},
require.resolve("./src/plugins/blog-related"),
[
// Programmatic SEO pages (#98). Files are generated into generated/pseo/
// by scripts/generate-pseo.js (run before build/start) and served at the
// site root, e.g. generated/pseo/ai-testing-react.mdx -> /ai-testing-react/.
"@docusaurus/plugin-content-pages",
{
id: "pseo",
path: "generated/pseo",
routeBasePath: "/",
},
],
[
// Second blog instance: the public changelog at /changelog/ (entries in
// changelog/). Separate from the main blog so posts stay short, dated
// release notes without authors/tags.
"@docusaurus/plugin-content-blog",
{
id: "changelog",
path: "changelog",
routeBasePath: "/changelog",
blogTitle: "Changelog",
blogDescription:
"Wopee.io changelog: new autonomous testing features, integrations, and platform improvements, what shipped and when.",
blogSidebarTitle: "Recent updates",
blogSidebarCount: "ALL",
showReadingTime: false,
archiveBasePath: null,
onUntruncatedBlogPosts: "ignore",
},
],
],
presets: [
[
"@docusaurus/preset-classic",
{
docs: false,
// docs: {
// sidebarPath: require.resolve("./sidebars.js"),
// editUrl: "https://github.com/autonomous-testing/wopee.io/",
// },
blog: {
exclude: ["**/blog/2019*"],
blogDescription:
"Guides, research and case studies on AI-driven autonomous testing: test generation, self-healing, visual testing and Playwright in CI.",
blogSidebarCount: 0,
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
// URL redirects are NOT handled here. plugin-client-redirects emitted
// HTML pages with a window.location hop, which Google reads as HTTP 200
// with a self-canonical, so retired URLs kept ranking and competing with
// their replacements. Redirects are now real 301s at the edge
// (Cloudflare Bulk Redirects, list "wopee_retired_urls").
// redirects.csv in this repo is the version-controlled copy of that list.
sitemap: {
// Generated pSEO routes live in a gitignored folder, so Docusaurus finds
// no git date for them and emits no <lastmod>. Fill those in from the
// date of the data file they are generated from, and give the blog and
// changelog index pages the date of their newest entry.
createSitemapItems: async ({ defaultCreateSitemapItems, ...rest }) => {
const items = await defaultCreateSitemapItems(rest);
const pseoDate = require("child_process")
.execSync("git log -1 --format=%cs -- data/pseo-pages.json")
.toString()
.trim();
const newestUnder = (prefix) =>
items
.filter((i) => i.url.includes(prefix) && i.lastmod)
.map((i) => i.lastmod)
.sort()
.pop();
return items.map((item) => {
if (item.lastmod) return item;
const path = new URL(item.url).pathname;
if (path.startsWith("/ai-") && pseoDate) {
return { ...item, lastmod: pseoDate };
}
const parent = path.startsWith("/changelog") ? "/changelog/" : "/blog/";
const fallback = newestUnder(parent);
return fallback ? { ...item, lastmod: fallback } : item;
});
},
// Emit <lastmod> so Google has a freshness signal to schedule recrawls.
// Without it the sitemap looks unchanged and pages published after the
// last processing date (2026-05-29) stayed unknown to Google.
lastmod: "date",
// NOTE: with `trailingSlash: true`, generated URLs end in `/`.
// Bare-path patterns like "/l" do NOT match "/l/", use "/l/**" or "/l/" instead.
// Ahrefs flagged 5 of these as orphan pages (May 2026) because the patterns silently failed.
ignorePatterns: [
"/tags/**",
"/blog/**/page/**",
"/billing/**",
"/blog/archive/**",
"/blog/authors/**",
"/blog/tags/**",
"/marcel/**",
"/jan-beranek/**",
"/ux/**",
"/onboarding/**",
"/bot/**",
"/team/**",
"/testing-bot/**",
],
},
// Only emit analytics in production builds. GA4 (G-PVTHWLV51B) and
// Google Ads run from the GTM container with Consent Mode, including
// page_view on client-side navigation; no separate gtag plugin.
googleTagManager:
process.env.NODE_ENV === "production"
? { containerId: "GTM-T54MTRSZ" }
: undefined,
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
{
// Site-wide share card (1200x630), rendered by scripts/og-cards/generate.cjs.
// Root emits its og:image:width/height/alt; pages with their own card override them.
image: require("./static/img/og/manifest.json")["*"].image.replace(/^\//, ""),
// Docusaurus's classic theme emits og:title, og:description, og:image, og:url,
// og:locale and twitter:card/twitter:image automatically. It does NOT emit
// og:type or og:site_name, both flagged by Ahrefs as "Open Graph tags
// incomplete" across the whole site. The blog plugin overrides og:type with
// "article" on individual blog posts.
metadata: [
{ property: "og:type", content: "website" },
{ property: "og:site_name", content: "Wopee.io" },
...(isProductionSite
? []
: [{ name: "robots", content: "noindex, nofollow" }]),
],
// https://docusaurus.io/docs/api/themes/configuration#color-mode---dark-mode
colorMode: {
defaultMode: "dark",
disableSwitch: false,
// Set dark mode as the default, but allow users switching to light mode.
// respectPrefersColorScheme: false,
},
navbar: {
// The wordmark is always one colour (DESIGN.md, Logo): ink on light, white on
// dark. Yellow lives in the symbol, the headline marker and the button.
// No `title`: the SVG is the name.
logo: {
alt: "Wopee.io",
src: "brand/svg/wopee-wordmark-mono-ink.svg",
srcDark: "brand/svg/wopee-wordmark-mono-white.svg",
width: 139,
height: 30,
className: "navbar-brand-logo",
},
items: [
{
type: "dropdown",
label: "Product",
position: "left",
items: [
{ to: "/how-it-works/", html: navRichItem("How it works", "From URL to reviewed tests, step by step", mdiRoutes) },
{ to: "/ai-testing-agents/", html: navRichItem("AI Testing Agents", "Autonomous agents that test your web app", mdiRobotOutline) },
{ to: "/managed-testing/", html: navRichItem("Managed testing", "We write, run and maintain your tests", mdiAccountCheckOutline) },
{ to: "/visual-testing/", html: navRichItem("Visual Testing", "Catch visual regressions on every run", mdiEyeCheckOutline) },
{ to: "/mcp/", html: navRichItem("MCP Server", "Test from Claude, Cursor, and other AI tools", mdiConnection) },
{ to: "/integrations/", html: navRichItem("Integrations", "Slack, GitHub, CI, MCP, and your stack", mdiPuzzleOutline) },
{ to: "/security/", html: navRichItem("Security & Trust", "How we handle your data and access", mdiShieldCheckOutline) },
{ to: "/compare/", html: navRichItem("Compare tools", "Honest comparisons with the alternatives", mdiScaleBalance) },
{ to: "/learn/", html: navRichItem("Free tutorials", "Hands-on labs on AI testing agents", mdiSchoolOutline, learnShowNew ? "New" : "") },
],
},
{ to: "/pricing/", label: "Pricing", position: "left" },
{ to: "/enterprise/", label: "Enterprise", position: "left" },
{ to: "/customers/", label: "Customers", position: "left" },
{ href: "https://docs.wopee.io/", label: "Docs", position: "left" },
// Shown from 1200 px up (custom.css) so Log in and Start for free never move.
...(learnHubLive
? [{ to: "/learn/", label: "Learn", position: "left", className: "navbar-learn" }]
: []),
{ to: "/blog/", label: "Blog", position: "left" },
{
to: "https://cmd.wopee.io/login",
target: "_blank",
label: "Log in",
position: "right",
className: "margin-right--md",
id: "login-button",
},
{
to: "https://cmd.wopee.io/login",
target: "_blank",
label: "Start for free",
position: "right",
className: "margin-right--md",
id: "navbar-button",
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
},
};
module.exports = config;