Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
160 lines (156 loc) · 3.9 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
160 lines (156 loc) · 3.9 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
const { themes } = require('prism-react-renderer');
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
const AG_PARTNER_WEBSITE_URL = 'https://adguardpartner.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-partner.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 Partner program',
tagline: 'Knowledge Base for AdGuard Partner program',
url: url,
baseUrl: baseUrl,
onBrokenLinks: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
favicon: 'img/favicon.svg',
trailingSlash: true,
organizationName: 'AdGuard',
projectName: 'adguard-partner-kb',
themes: ['docusaurus-theme-search-typesense'],
i18n: {
defaultLocale: 'en',
locales: ['en', 'ru'],
},
headTags: [
{
tagName: 'script',
attributes: {
type: 'application/ld+json',
},
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'AdGuard',
url: 'https://adguardpartner.com/',
logo: 'https://adguardpartner.com/kb/img/logo.svg',
}),
},
],
themeConfig: {
colorMode: {
defaultMode: 'light',
respectPrefersColorScheme: true,
},
docs: {
sidebar: {
hideable: true,
}
},
navbar: {
hideOnScroll: true,
title: '',
logo: {
alt: 'AdGuard Partner',
src: 'img/logo.svg',
srcDark: 'img/logo_dark.svg',
},
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'docs',
},
{
to: AG_PARTNER_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/KnowledgeBasePartner',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'light',
logo: {
alt: 'AdGuard Partner program',
src: 'img/logo_dark.svg',
srcDark: 'img/logo_dark.svg',
},
links: [
{
title: 'adguard_partner_program',
items: [
{
label: 'official_website',
href: AG_PARTNER_WEBSITE_URL,
},
],
},
],
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/KnowledgeBasePartner/edit/master/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};