Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
154 lines (150 loc) · 3.67 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
154 lines (150 loc) · 3.67 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
const { themes } = require('prism-react-renderer');
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
const AG_MAIL_WEBSITE_URL = 'https://adguard-mail.com';
// Allow to parameterise the website URL and the base path during the build.
// By default, the website is published to Cloudflare Pages.
const url = process.env.URL || 'https://kb-mail.pages.dev';
const baseUrl = process.env.BASE_URL || '/';
const typesenseCollectionName = process.env.SEARCH_COLLECTION || 'docusaurus-2';
const typesenseHost = process.env.SEARCH_HOST || 'xxx-1.a1.typesense.net';
const typesenseApiKey = process.env.SEARCH_API_KEY || 'test';
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
future: {
faster: true,
v4: {
removeLegacyPostBuildHeadAttribute: true,
},
},
title: 'AdGuard Mail Knowledge Base',
tagline: 'Knowledge Base for AdGuard Mail',
url: url,
baseUrl: baseUrl,
onBrokenLinks: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
favicon: 'img/favicon.ico',
trailingSlash: true,
organizationName: 'AdGuard',
projectName: 'adguard-mail-kb',
themes: ['docusaurus-theme-search-typesense'],
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
themeConfig: {
colorMode: {
defaultMode: 'light',
respectPrefersColorScheme: true,
},
docs: {
sidebar: {
hideable: true,
}
},
navbar: {
hideOnScroll: true,
title: '',
logo: {
alt: 'AdGuard Mail',
src: 'img/logo.svg',
srcDark: 'img/logo_dark.svg',
},
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'docs',
},
{
to: AG_MAIL_WEBSITE_URL,
position: 'left',
label: 'official_website',
},
{
type: 'localeDropdown',
position: 'right',
dropdownItemsAfter: [
{
to: '/miscellaneous/update-kb',
label: 'Help Us Translate',
},
],
},
{
href: 'https://github.com/AdguardTeam/KnowledgeBaseMail',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'light',
logo: {
alt: 'AdGuard Mail',
src: 'img/logo.svg',
srcDark: 'img/logo_dark.svg',
},
links: [
{
title: 'adguard_mail',
items: [
{
label: 'official_website',
href: AG_MAIL_WEBSITE_URL,
},
],
},
{
title: 'support',
items: [
{
label: 'support_center',
href: AG_MAIL_WEBSITE_URL + '/support.html',
},
],
},
],
copyright: `© 2009–${new Date().getFullYear()} Adguard Software Ltd.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
typesense: {
typesenseCollectionName: typesenseCollectionName,
typesenseServerConfig: {
nodes: [
{
host: typesenseHost,
port: 443,
protocol: 'https',
},
],
apiKey: typesenseApiKey,
},
contextualSearch: true,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/',
editUrl:
'https://github.com/AdguardTeam/KnowledgeBaseMail/edit/master/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};