Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
287 lines (284 loc) · 7.45 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
287 lines (284 loc) · 7.45 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
import path from "path";
import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";
const config: Config = {
title: "Velopack",
tagline:
"Installer and automatic update framework for cross-platform desktop applications",
favicon: "favicon/favicon.ico",
url: "https://docs.velopack.io/",
baseUrl: "/",
trailingSlash: false,
organizationName: "velopack",
projectName: "velopack.docs",
onBrokenLinks: "throw",
onBrokenAnchors: "throw",
i18n: {
defaultLocale: "en",
locales: ["en", "es"],
localeConfigs: {
en: { label: "English", htmlLang: "en" },
es: { label: "Español", htmlLang: "es" },
},
},
customFields: {
flowBaseUrl: "https://app.velopack.io",
// The "Ask AI" chat widget (src/components/DocsAssist), backed by the velopack.docsassist Worker.
// Remove this to turn the widget off (and `askAi` in the search theme below).
docsAssist: {
apiBase: "https://velopack-docsassist.ukkgtz.workers.dev",
turnstileSiteKey: "0x4AAAAAAFYfg6Vtz5i8EVl9",
},
},
themes: [
[
"@easyops-cn/docusaurus-search-local",
{
hashed: true,
indexBlog: false,
docsRouteBasePath: "/",
ignoreFiles: new RegExp(".*reference/.*"),
language: ["en", "es"],
// Adds an "Ask AI: <query>" row to search results. Its options are ignored: the
// docs-assist-search-bridge plugin below points it at our own widget.
askAi: {},
},
],
"@docusaurus/theme-mermaid",
],
plugins: [
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{ from: "/packaging/rid", to: "/packaging/runtime" },
{ from: "/troubleshooting/cli", to: "/reference/cli" },
{ from: "/category/quick-start", to: "/category/getting-started" },
],
},
],
// The search theme's "Ask AI" row opens the `AskAIWidget` from the `open-ask-ai` package.
// Swap that package for src/components/DocsAssist/searchBridge.tsx, which opens our widget.
(context) => ({
name: "docs-assist-search-bridge",
configureWebpack: () => ({
resolve: {
alias: {
"open-ask-ai$": path.join(context.siteDir, "src/components/DocsAssist/searchBridge.tsx"),
"open-ask-ai/styles.css": false,
},
},
}),
}),
],
headTags: [
// Favicon
{
tagName: "link",
attributes: { rel: "shortcut icon", href: "/favicon/favicon.ico" },
},
{
tagName: "link",
attributes: {
rel: "apple-touch-icon",
sizes: "180x180",
href: "/favicon/apple-touch-icon.png",
},
},
{
tagName: "link",
attributes: {
rel: "icon",
type: "image/png",
sizes: "32x32",
href: "/favicon/icon_32.png",
},
},
{
tagName: "link",
attributes: {
rel: "icon",
type: "image/png",
sizes: "16x16",
href: "/favicon/icon_16.png",
},
},
{
tagName: "link",
attributes: { rel: "manifest", href: "/favicon/site.webmanifest" },
},
{
tagName: "link",
attributes: {
rel: "mask-icon",
href: "/favicon/safari-pinned-tab.svg",
color: "#edd323",
},
},
{
tagName: "meta",
attributes: { name: "msapplication-TileColor", content: "#000000" },
},
{
tagName: "meta",
attributes: { name: "theme-color", content: "#ffffff" },
},
],
markdown: {
format: "detect",
mermaid: true,
hooks: {
onBrokenMarkdownLinks: "throw",
},
},
presets: [
[
"classic",
{
docs: {
sidebarPath: "./sidebars.ts",
routeBasePath: "/",
editUrl: ({ versionDocsDirPath, docPath, locale }) => {
let match;
if ((match = docPath.match(/reference\/.*/)) != null) {
return undefined; // reference pages can't be edited
}
if (locale != "en") {
return undefined;
// return 'https://crowdin.com/project/velopack/invite?h=88bec14b5657f004fe5ba325090df5ba2031736';
}
return `https://github.com/velopack/velopack.docs/tree/master/${versionDocsDirPath}/${docPath}`;
},
showLastUpdateTime: false,
showLastUpdateAuthor: false,
},
blog: {
showReadingTime: true,
},
theme: {
customCss: "./src/css/custom.css",
},
gtag: {
trackingID: "G-YM5CQ7KMDT",
anonymizeIP: true,
},
} satisfies Preset.Options,
],
],
themeConfig: {
image: "logo/opengraph.png",
colorMode: {
respectPrefersColorScheme: true,
},
navbar: {
// title: 'Velopack',
hideOnScroll: false,
logo: {
alt: "Velopack Logo",
src: "logo/velopack-black.svg",
srcDark: "logo/velopack-white.svg",
},
items: [
{
type: "docSidebar",
sidebarId: "mainSidebar",
position: "left",
label: "Guides",
},
{
type: "docSidebar",
sidebarId: "referenceSidebar",
position: "left",
label: "Reference",
},
{
to: "/blog",
label: "Blog",
position: "left",
},
{
type: "localeDropdown",
position: "right",
},
{
href: "https://github.com/velopack/velopack",
position: "right",
className: "header-icon header-icon-github",
"aria-label": "GitHub repository",
},
{
href: "https://discord.gg/CjrCrNzd3F",
position: "right",
className: "header-icon header-icon-discord",
"aria-label": "Discord invite",
},
],
},
docs: {
sidebar: {
autoCollapseCategories: true,
},
},
// footer: {
// style: 'dark',
// links: [
// {
// title: 'Docs',
// items: [
// {
// label: 'Tutorial',
// to: '/docs/intro',
// },
// ],
// },
// {
// title: 'Community',
// items: [
// {
// label: 'Stack Overflow',
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
// },
// {
// label: 'Discord',
// href: 'https://discordapp.com/invite/docusaurus',
// },
// {
// label: 'Twitter',
// href: 'https://twitter.com/docusaurus',
// },
// ],
// },
// {
// title: 'More',
// items: [
// {
// label: 'Blog',
// to: '/blog',
// },
// {
// label: 'GitHub',
// href: 'https://github.com/facebook/docusaurus',
// },
// ],
// },
// ],
// copyright: `Copyright © ${new Date().getFullYear()} Velopack Ltd.`,
// },
prism: {
additionalLanguages: [
"csharp",
"rust",
"cpp",
"batch",
"powershell",
"java",
"toml",
"json",
],
theme: prismThemes.oneLight,
darkTheme: prismThemes.nightOwl,
},
} satisfies Preset.ThemeConfig,
};
export default config;