forked from riok/mapperly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
213 lines (206 loc) · 5.75 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
213 lines (206 loc) · 5.75 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
// @ts-check
/** @typedef {import('@docusaurus/types').Config} Config */
const { themes } = require('prism-react-renderer');
const mapperlyVersion = process.env.MAPPERLY_VERSION || '0.0.1-dev';
const environment = process.env.ENVIRONMENT || 'local';
/** @type {import('./src/custom-fields').CustomFields} */
const customFields = {
mapperlyVersion,
environment: {
name: environment,
stable: environment === 'stable',
next: environment === 'next',
local: environment === 'local',
},
};
async function createConfig() {
const rehypeFaq = (await import('./src/plugins/rehype/rehype-faq/index.js'))
.default;
/** @type {Config} */
return {
customFields,
title: 'Mapperly',
tagline:
'A .NET source generator for generating object mappings. No runtime reflection.',
url: process.env.DOCUSAURUS_URL || 'https://mapperly.riok.app',
baseUrl: process.env.DOCUSAURUS_BASE_URL || '/',
trailingSlash: true,
favicon: 'img/logo.svg',
organizationName: 'riok',
projectName: 'mapperly',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'throw',
onBrokenMarkdownImages: 'throw',
},
},
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
rehypePlugins: [rehypeFaq],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
metadata: [
{
name: 'keywords',
content: '.NET, SourceGenerator, Mapping, Roslyn, dotnet',
},
],
colorMode: {
disableSwitch: true,
},
navbar: {
title: 'Mapperly',
logo: {
alt: 'Mapperly Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Documentation',
sidebarId: 'docs',
},
{
type: 'doc',
docId: '/category/api',
position: 'left',
label: 'API',
sidebarId: 'api',
},
{
type: 'doc',
docId: 'contributing/index',
position: 'left',
label: 'Contributing',
sidebarId: 'contributing',
},
{
type: 'custom-coffeeNavbarItem',
position: 'right',
},
{
type: 'custom-versionsNavbarItem',
position: 'right',
},
{
href: 'https://github.com/riok/mapperly',
className: 'headerGithubLink',
'aria-label': 'GitHub repository',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'riok Logo',
src: '/img/riok-logo-grayscale.svg',
href: 'https://riok.ch',
width: '180px',
},
copyright:
'Mapperly is an open source project of <a href="https://riok.ch">riok</a>.',
links: [
{
title: 'Docs',
items: [
{
label: 'Introduction',
to: '/docs/intro',
},
{
label: 'Installation',
to: '/docs/getting-started/installation',
},
{
label: 'Configuration',
to: '/docs/category/usage-and-configuration',
},
],
},
{
title: 'Community',
items: [
{
label: 'Q&A',
href: 'https://github.com/riok/mapperly/discussions',
},
{
label: 'Open an issue',
href: 'https://github.com/riok/mapperly/issues/new/choose',
},
{
label: 'Contributing',
to: '/docs/contributing',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub Repository',
href: 'https://github.com/riok/mapperly',
},
{
label: 'NuGet',
href: 'https://www.nuget.org/packages/Riok.Mapperly',
},
{
label: 'Releases',
href: 'https://github.com/riok/mapperly/releases',
},
],
},
{
title: 'Legal',
items: [
{
label: 'License',
href: 'https://github.com/riok/mapperly/blob/main/LICENSE',
},
],
},
],
},
prism: {
theme: themes.github,
darkTheme: themes.dracula,
additionalLanguages: ['csharp', 'powershell', 'editorconfig', 'bash'],
},
}),
plugins: [
[
'@docusaurus/plugin-ideal-image',
/** @type {import('@docusaurus/plugin-ideal-image').PluginOptions} */
({
max: 1600,
min: 400,
// Use false to debug, but it incurs huge perf costs
disableInDev: true,
}),
],
'@easyops-cn/docusaurus-search-local',
],
};
}
module.exports = createConfig;