-
Notifications
You must be signed in to change notification settings - Fork 9
/
docusaurus.config.ts
258 lines (239 loc) · 6.23 KB
/
docusaurus.config.ts
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
/*
* Copyright 2024 CodeRabbit AI Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { themes as prismThemes } from "prism-react-renderer"
import { EnumChangefreq } from "sitemap"
import type * as Preset from "@docusaurus/preset-classic"
import type { Config } from "@docusaurus/types"
const baseUrl = "/"
const config: Config = {
title: "CodeRabbit",
staticDirectories: ["static"],
tagline: "AI-powered Code Reviews",
favicon: "img/favIcon.png",
// Set the production url of your site here
url: "https://docs.coderabbit.ai/",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: baseUrl,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "coderabbit", // Usually your GitHub org/user name.
projectName: "coderabbit-docs", // Usually your repo name.
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onDuplicateRoutes: "warn",
// Even if you don't use internationalization, 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: [
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
from: "/get-started",
to: "/getting-started/quickstart/",
},
{
from: "/about/features",
to: "/",
},
{
from: "/about/pricing",
to: "/",
},
{
from: "/about/support",
to: "/getting-started/support",
},
{
from: "/guides/customize-coderabbit",
to: "/getting-started/configure-coderabbit",
},
{
from: "/guides/prompt-customization",
to: "/guides/review-instructions",
},
{
from: "/guides/configure-coderabbit",
to: "/getting-started/configure-coderabbit",
},
{
from: "/integrations/saas-gitlab",
to: "/platforms/gitlab-com",
},
{
from: "/integrations/self-hosted-gitlab",
to: "/platforms/self-hosted-gitlab",
},
{
from: "/integrations/self-hosted-github",
to: "/platforms/github-enterprise-server",
},
{
from: "/platforms/saas-azure-devops",
to: "/platforms/azure-devops",
},
{
from: "/platforms/saas-gitlab",
to: "/platforms/gitlab-com",
},
{
from: "/platforms/self-hosted-github",
to: "/platforms/github-enterprise-server",
},
{
from: "/configure-coderabbit",
to: "/getting-started/configure-coderabbit",
},
],
},
],
async 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
},
}
},
],
presets: [
[
"classic",
{
docs: {
editUrl: "https://github.com/coderabbitai/coderabbit-docs/edit/main/",
sidebarPath: "./sidebars.ts",
path: "docs",
routeBasePath: "/",
breadcrumbs: true,
showLastUpdateTime: true,
},
blog: false,
theme: {
customCss: "./src/css/custom.css",
},
sitemap: {
changefreq: "weekly" as EnumChangefreq,
priority: 0.5,
ignorePatterns: ["/tags/**"],
filename: "sitemap.xml",
},
googleTagManager: {
containerId: "GTM-5BWLXJRC",
},
} satisfies Preset.Options,
],
],
themes: ["docusaurus-json-schema-plugin"],
scripts: [
"https://buttons.github.io/buttons.js",
"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js",
"/docs/js/code-block-buttons.js",
"https://cdnjs.cloudflare.com/ajax/libs/axios/1.2.1/axios.min.js",
{
src: "/js/segment.js",
async: false,
},
{
src: "https://js.hs-scripts.com/43613284.js",
type: "text/javascript",
id: "hs-script-loader",
async: true,
defer: true,
},
{
src: "https://cdnjs.cloudflare.com/ajax/libs/axios/1.2.1/axios.min.js",
async: true,
},
],
themeConfig: {
image: "img/preview.png",
colorMode: {
defaultMode: "light",
disableSwitch: false,
respectPrefersColorScheme: false,
},
docs: {
sidebar: {
hideable: true,
},
},
metadata: [{ name: "twitter:card", content: "summary_large_image" }],
navbar: {
title: "",
hideOnScroll: true,
logo: {
alt: "CodeRabbit",
src: "img/logo/bw_coderabbit.svg",
srcDark: "img/logo/white_coderabbit.svg",
href: "https://coderabbit.ai",
target: "_self",
},
items: [
{
label: "Docs",
position: "left",
to: "/",
className: "navbar-link-active",
},
{
href: "https://coderabbit.ai/blog",
label: "Blog",
position: "left",
},
{
href: "https://discord.gg/coderabbit",
className: "navbar-icon-link discord-link",
"aria-label": "Discord",
position: "right",
},
{
href: "https://github.com/coderabbitai/coderabbit-docs",
className: "github-link",
"aria-label": "GitHub",
position: "right",
},
],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
algolia: {
// The application ID provided by Algolia
appId: "4MKM4DJT5D",
// Public API key: it is safe to commit it
apiKey: "b1d63b99cbda8ec3668777e644ecefa2",
indexName: "coderabbit",
// Optional: see doc section below
contextualSearch: false,
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: "search",
},
} satisfies Preset.ThemeConfig,
}
export default config