-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
167 lines (157 loc) · 5.2 KB
/
docusaurus.config.js
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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
// TODO remove the redirects from the old pages, we should update all GH repositories to link to new docs.
// This ensures URLs to our old Antora-based docs are successfully redirected to Docusaurus-based URLs
let oldVersions = ["latest", "0.21.0", "0.20.1", "0.20.0", "0.19.0", "0.18.0", "0.17.0", "0.16.0", "0.15.0", "0.14.0", "0.13.2", "0.13.1", "0.13.0", "0.12.0", "0.11.0", "0.10.0", "0.9.0", "0.8.0", "0.7.0", "0.6.0", "0.5.1", "0.5.0", "0.4.1", "0.3.1"]
let oldOverviewPages = ["pii", "organization", "hla"];
let replacements = [];
for (let oldVersion of oldVersions) {
for (let oldOverviewPage of oldOverviewPages) {
replacements.push({
from: `/docs/${oldVersion}/${oldOverviewPage}.html`,
to: `/docs/latest/overview/${oldOverviewPage}`,
});
}
replacements.push({
from: `/docs/${oldVersion}/about.html`,
to: `/docs/latest/overview/`,
});
replacements.push({
from: `/docs/${oldVersion}/definitions.html`,
to: `/docs/latest/concepts/definitions`,
});
replacements.push({
from: `/docs/${oldVersion}/concepts/schemas-and-contracts.html`,
to: `/docs/latest/concepts/data-contracts/`,
});
}
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'STRM Privacy Documentation',
url: 'https://docs.strmprivacy.io/',
baseUrl: '/',
projectName: 'docs',
organizationName: 'strmprivacy',
baseUrlIssueBanner: false,
trailingSlash: true,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.svg',
scripts: [
{
src: 'https://plausible.io/js/plausible.js',
defer: true,
'data-domain': 'docs.strmprivacy.io'
}
],
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/docs',
lastVersion: 'current',
versions: {
current: {
label: 'latest',
path: 'latest',
},
},
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
sitemap: {
changefreq: 'daily',
priority: 0.5,
}
},
],
],
themeConfig:
({
navbar: {
logo: {
alt: 'STRM Privacy Logo',
src: 'https://storage.googleapis.com/strm-media/strm-logo-orange-slim.svg',
href: '/',
target: '_self',
},
items: [
{
type: 'doc',
position: 'left',
docId: 'overview/index',
label: 'Docs',
},
{
label: 'Hiring!',
position: 'left',
to: 'https://join.strm.team/',
},
{
href: 'https://github.com/strmprivacy',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
}
],
},
footer: {
style: 'dark',
copyright: `Copyright (C) 2020-${(new Date().getFullYear())} STRM Privacy`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['typescript', 'java', 'php', 'rust'],
magicComments: [
{className: 'callout callout-1', line: 'callout-1',},
{className: 'callout callout-2', line: 'callout-2',},
{className: 'callout callout-3', line: 'callout-3',},
{className: 'callout callout-4', line: 'callout-4',},
{className: 'callout callout-5', line: 'callout-5',},
{className: 'callout callout-6', line: 'callout-6',},
{className: 'callout callout-7', line: 'callout-7',},
{className: 'callout callout-8', line: 'callout-8',},
{className: 'callout callout-9', line: 'callout-9',},
{className: 'callout callout-10', line: 'callout-10',},
{className: 'callout callout-11', line: 'callout-11',},
{className: 'callout callout-12', line: 'callout-12',},
{className: 'callout callout-13', line: 'callout-13',},
{className: 'callout callout-14', line: 'callout-14',},
{className: 'callout callout-15', line: 'callout-15',},
{className: 'callout callout-16', line: 'callout-16',},
{className: 'callout callout-17', line: 'callout-17',},
{className: 'callout callout-18', line: 'callout-18',},
{className: 'callout callout-19', line: 'callout-19',},
{className: 'callout callout-20', line: 'callout-20',},
]
},
algolia: {
appId: 'M24OHV52F0',
apiKey: '75af5c8e621e102165a0787ee4581b54',
indexName: 'docusaurus-2',
},
}),
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage
redirects: [
...replacements,
{
from: '/docs/latest',
to: '/docs/latest/overview'
}
]
},
],
],
};
module.exports = config;