-
Notifications
You must be signed in to change notification settings - Fork 113
/
docusaurus.config.js
206 lines (203 loc) · 5.69 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
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
/**
* @type {import('redocusaurus').PresetEntry}
*/
const redocusaurus = [
'redocusaurus',
{
debug: Boolean(process.env.DEBUG || process.env.CI),
specs: [
{
id: 'using-single-yaml',
spec: 'openapi/single-file/openapi.yaml',
route: '/examples/using-single-yaml/',
},
{
id: 'using-multi-file-yaml',
spec: 'openapi/multi-file/openapi.yaml',
route: '/examples/using-multi-file-yaml/',
},
{
id: 'using-swagger-json',
spec: 'openapi/swagger/swagger.json',
route: '/examples/using-swagger-json/',
},
{
id: 'using-remote-url',
// Remote File
spec: 'https://redocly.github.io/redoc/openapi.yaml',
route: '/examples/using-remote-url/',
},
{
id: 'using-custom-page',
spec: 'openapi/single-file/openapi.yaml',
// NOTE: no `route` passed, instead data used in custom React Component ('custom-page/index.jsx')
},
{
id: 'using-custom-layout',
spec: 'openapi/single-file/openapi.yaml',
// NOTE: no `route` passed, instead data used in custom React Component ('custom-layout/index.jsx')
},
],
theme: {
/**
* Highlight color for docs
*/
primaryColor: '#1890ff',
/**
* Options to pass to redoc
* @see https://github.com/redocly/redoc#redoc-options-object
*/
options: { disableSearch: true },
/**
* Options to pass to override RedocThemeObject
* @see https://github.com/Redocly/redoc#redoc-theme-object
*/
theme: {},
},
},
];
if (process.env.VERCEL_URL) {
process.env.DEPLOY_PRIME_URL = `https://${process.env.VERCEL_URL}`;
}
/**
* @type {Partial<import('@docusaurus/types').DocusaurusConfig>}
*/
const config = {
presets: [
/** ************ Your other presets' config *********** */
[
'@docusaurus/preset-classic',
{
debug: Boolean(process.env.DEBUG || process.env.CI),
theme: { customCss: [require.resolve('./src/custom.css')] },
docs: {
routeBasePath: '/docs',
editUrl: 'https://github.com/rohit-gohri/redocusaurus/edit/main/website/',
},
},
],
// Redocusaurus Config
redocusaurus,
],
title: 'Redocusaurus',
tagline: 'OpenAPI solution for Docusaurus docs with Redoc',
customFields: {
meta: {
description: 'Integrate Redoc easily into your Docusaurus Site',
},
},
url: process.env.DEPLOY_PRIME_URL || 'http://localhost:5000', // Your website URL
baseUrl: process.env.DEPLOY_BASE_URL || '/', // Base URL for your project */
favicon: 'img/favicon.ico',
themeConfig: {
navbar: {
title: 'Redocusaurus',
items: [
{
label: 'Docs',
position: 'left',
to: '/docs',
},
{
label: 'Examples',
position: 'left',
items: [
{
label: 'All',
to: '/examples',
},
{
label: 'Using Single YAML',
to: '/examples/using-single-yaml/',
},
{
label: 'Using Remote URL',
to: '/examples/using-remote-url/',
},
{
label: 'Using Multiple YAMLs',
to: '/examples/using-multi-file-yaml/',
},
{
label: 'Using Swagger',
to: '/examples/using-swagger-json/',
},
{
label: 'Custom Page',
to: '/examples/custom-page/',
},
{
label: 'Custom Layout',
to: '/examples/custom-layout/',
},
],
},
{
label: 'v1',
position: 'right',
items: [
{
label: 'v0',
href: 'https://redocusaurus-v0.vercel.app/',
},
{
label: 'v1',
href: 'https://redocusaurus.vercel.app',
},
],
},
{
href: 'https://github.com/rohit-gohri/redocusaurus',
position: 'right',
className: 'header-github-logo',
'aria-label': 'GitHub Repo',
},
],
},
footer: {
// logo: {
// alt: 'Redocusaurus Logo',
// src: 'img/logoDark.png',
// },
style: 'dark',
links: [
{
title: 'NPM Modules',
items: [
{
label: 'Redocusaurus',
href: 'https://www.npmjs.com/package/redocusaurus/',
},
{
label: 'Docusaurus Theme Redoc',
href: 'https://www.npmjs.com/package/docusaurus-theme-redoc/',
},
{
label: 'Docusaurus Plugin Redoc',
href: 'https://www.npmjs.com/package/docusaurus-plugin-redoc/',
},
],
},
{
title: 'More',
items: [
{
label: 'Github',
href: 'https://github.com/rohit-gohri/redocusaurus/',
},
{
label: 'Blog Post',
href: 'https://rohit.page/blog/projects/openapi-for-docusaurus/',
},
{
label: 'Twitter Discussion',
href: 'https://twitter.com/rohit_gohri/status/1351589213565644801',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://rohit.page" target="_blank" rel="noopener noreferrer">Rohit Gohri</a>. Built with <a href="https://github.com/facebook/docusaurus" target="_blank" rel="noopener noreferrer">Docusaurus</a>`,
},
},
};
module.exports = config;