-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathdocusaurus.config.mjs
More file actions
226 lines (221 loc) · 6.38 KB
/
Copy pathdocusaurus.config.mjs
File metadata and controls
226 lines (221 loc) · 6.38 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
import { themes } from 'prism-react-renderer';
import myLoaders from './plugins/my-loaders.mjs';
import tailwindLoader from './plugins/tailwind-loader.mjs';
const SIGNUP_LINK =
'https://dashboard.algolia.com/users/sign_up?selected_plan=docsearch&utm_source=docsearch.algolia.com&utm_medium=referral&utm_campaign=docsearch&utm_content=apply';
// The MCP app is served at the same origin (/mcp) by hosting, not by
// Docusaurus. Linking to the absolute URL makes it an external link so the
// build's broken-link check doesn't flag a route Docusaurus doesn't own.
const MCP_URL = 'https://docsearch.algolia.com/mcp';
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
// @ts-check
// With JSDoc @type annotations, IDEs can provide config autocompletion
/** @type {import('@docusaurus/types').Config} */
export default {
title: 'DocSearch by Algolia',
tagline:
'The best search experience for docs, integrated in minutes, for free.',
url: 'https://docsearch.algolia.com',
baseUrl: '/',
favicon: 'img/favicon.ico',
organizationName: 'Algolia',
projectName: 'DocSearch',
onBrokenLinks: 'warn',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'throw',
},
},
future: {
v4: {
removeLegacyPostBuildHeadAttribute: true,
useCssCascadeLayers: false,
},
},
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: 'docs',
sidebarPath: 'sidebars.js',
editUrl:
'https://github.com/algolia/docsearch/edit/main/packages/website/',
versions: {
current: {
label: 'Latest (v4.x)',
},
v3: {
label: 'Legacy (v3.x)',
},
legacy: {
label: 'Legacy (v1.x - v2.x)',
},
},
lastVersion: 'current',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
plugins: [myLoaders, tailwindLoader, '@docsearch/docusaurus-adapter'],
themeConfig:
/** @type {import('@docsearch/docusaurus-adapter').ThemeConfig} */
({
docsearch: {
placeholder: 'Search or ask AI',
appId: 'PMZUYBQDAK',
apiKey: '24b09689d5b4223813d9b8e48563c8f6',
indices: [{ name: 'docsearch' }],
askAi: {
assistantId: 'ccdec697-e3fe-465b-a1c3-657e7bf18aef',
},
sidePanel: true,
contextualSearch: true,
searchPage: { path: 'search' },
translations: {
button: {
buttonText: 'Go on, give it a search...',
},
modal: {
footer: {
poweredByText: 'Powered by',
},
},
},
},
metadata: [
{
name: 'google-site-verification',
content: '23yIHmCD_xnJb_6e3s-w7M29Kydahk-d86ObMWOrvRg',
},
],
navbar: {
hideOnScroll: true,
// Brand lockup is rendered by the swizzled Navbar/Logo (MCP vibe);
// no image `logo` config needed.
items: [
// left
{
label: 'Documentation',
to: 'docs/what-is-docsearch',
position: 'left',
},
{
label: 'MCP',
href: MCP_URL,
target: '_self',
position: 'left',
className: 'navbar-mcp-link',
},
{
label: 'Sign up',
to: SIGNUP_LINK,
position: 'left',
className: 'navbar-cta',
},
// right
{
type: 'docsVersionDropdown',
position: 'right',
},
{
href: 'https://github.com/algolia/docsearch',
position: 'right',
className: 'header-github-link',
},
],
},
announcementBar: {
id: 'announcement-bar',
content:
'🚀 Get Ask AI now! Turn your docs site search into an AI-powered assistant – faster answers, fewer tickets, better self-serve. <a target="_blank" rel="noopener noreferrer" href="https://dashboard.algolia.com/ask-ai">Get Started Now</a>',
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
footer: {
links: [
{
title: 'Docs',
items: [
{
label: 'Getting Started',
to: 'docs/what-is-docsearch',
},
{
label: 'FAQ',
to: 'docs/docsearch-program',
},
{
label: 'DocSearch v3',
to: 'docs/v3/docsearch',
},
{
label: 'DocSearch v4 - Beta',
to: 'docs/docsearch',
},
],
},
{
title: 'DocSearch',
items: [
{
label: 'Sign up',
to: SIGNUP_LINK,
},
{
label: 'Issues',
to: 'https://github.com/algolia/docsearch/issues',
},
{
label: 'Privacy',
to: 'https://www.algolia.com/policies/privacy/',
},
],
},
{
title: 'Community',
items: [
{
label: 'Discord',
to: 'https://discord.com/invite/W7kYfh7FKQ',
},
],
},
{
title: 'Social',
items: [
{
label: 'GitHub',
to: 'https://github.com/algolia/docsearch',
},
{
label: 'Twitter',
to: 'https://twitter.com/docsearch_',
},
{
label: 'Algolia Blog',
to: 'https://algolia.com/blog/',
},
],
},
],
// Brand lockup rendered by the swizzled Footer (MCP vibe).
copyright: `2015–${currentYear} — Built with <span style="color:var(--accent)">♥</span> by Algolia`,
},
image: 'img/og_image.png',
prism: {
theme: themes.github,
darkTheme: themes.dracula,
},
}),
};