-
Notifications
You must be signed in to change notification settings - Fork 7
/
docusaurus.config.js
153 lines (149 loc) · 4.15 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const { themes } = require("prism-react-renderer");
const { externalPackages } = require("./scripts/external-packages.cjs");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Argos",
tagline:
"Official documentation of Argos, the visual testing platform for modern engineering teams.",
url: "https://argos-ci.com",
baseUrl: process.env.VERCEL_ENV === "production" ? "/docs" : "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
favicon: "img/favicon.png",
organizationName: "Argos",
projectName: "docs",
deploymentBranch: "main",
trailingSlash: false,
titleDelimiter: "-",
i18n: { defaultLocale: "en", locales: ["en"] },
scripts: [
{
src: "https://plausible.io/js/script.js",
defer: true,
"data-domain": "argos-ci.com",
},
],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
sidebarCollapsible: true,
editUrl: (params) => {
// External docs
const fullPath = `docs/${params.docPath}`;
const externalPackage = externalPackages.find((p) =>
fullPath.startsWith(p.target),
);
if (externalPackage) {
return `https://github.com/argos-ci/argos-javascript/blob/main/${externalPackage.src}/index.mdx`;
}
return `https://github.com/argos-ci/docs/blob/main/docs/${params.docPath}`;
},
},
theme: {
customCss: "./src/css/custom.css",
},
sitemap: {
// Remove redirect and orphan pages from sitemap
ignorePatterns: ["/docs/", "/docs/search"],
},
googleTagManager: {
containerId: "GTM-NLJR9K93",
},
}),
],
],
themes: ["@docusaurus/theme-mermaid"],
markdown: {
mermaid: true,
},
plugins: [
function myPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
from: "/installation",
to: "/getting-started",
},
{
from: "/quickstart",
to: "/getting-started",
},
{
from: "/quickstart/remix",
to: "/quickstart/react-router",
},
],
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: "img/social-card.jpg",
colorMode: {
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: "",
logo: {
alt: "Argos",
src: "img/logo-nav-light.svg",
srcDark: "img/logo-nav-dark.svg",
href: "/getting-started",
},
items: [
{
type: "search",
position: "right",
},
{
to: "https://app.argos-ci.com/",
position: "left",
label: "Go to Argos app",
},
{
href: "https://github.com/argos-ci",
position: "right",
className: "header-link github-header-link",
"aria-label": "GitHub repository",
},
{
href: "https://argos-ci.com/discord",
position: "right",
className: "header-link discord-header-link",
"aria-label": "Argos Discord channel",
},
],
},
prism: {
theme: themes.github,
darkTheme: themes.nightOwl,
},
algolia: {
appId: "S8JDA82FPQ",
apiKey: "a772ca710e0e36d90ad9b9eccce92f8f",
indexName: "argos-ci",
},
}),
};
module.exports = config;