-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathdocusaurus.config.ts
177 lines (168 loc) · 4.34 KB
/
docusaurus.config.ts
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
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type * as Redocusaurus from 'redocusaurus';
const env = process.env['ENV'];
const PUBLIC_API_OPENAPI_JSON_PATH = './static/openapi.json';
const getOpenAPIJsonFromEnv = (): string => {
if (env === 'dev') {
return 'http://localhost:5001/openapi.json';
}
return PUBLIC_API_OPENAPI_JSON_PATH;
}
const getDocumentationBaseUrlFromEnv = (): string => {
if (env === 'testing' || env === 'staging') {
return `https://developers.${env}.passculture.team`;
}
if (env === 'production') {
return 'https://developers.passculture.pro';
}
return 'http://localhost:3000';
}
const config: Config = {
title: 'API documentation',
tagline: '',
favicon: 'img/pass_culture_doc.png',
url: getDocumentationBaseUrlFromEnv(),
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
trailingSlash: false,
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
// Redocusaurus config
[
'redocusaurus',
{
specs: [
{
spec: getOpenAPIJsonFromEnv(),
route: '/rest-api/',
},
],
theme: {
primaryColor: '#320096',
},
},
] satisfies Redocusaurus.PresetEntry,
],
themeConfig: {
image: 'img/pass-culture-social-card.jpg',
colorMode: {
disableSwitch: true,
},
navbar: {
title: 'pass Culture Developers',
logo: {
alt: 'pass Culture Logo',
src: 'img/pass_culture_doc.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
},
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'REST API',
href: '/rest-api/',
},
{
to: '/change-logs',
label: 'Change logs',
position: 'left',
},
{
href: 'https://github.com/pass-culture/pass-culture-main',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'pass Culture websites',
items: [
{
label: 'For cultural partners',
href: 'https://passculture.pro/accueil',
},
{
label: 'For beneficiaries',
href: 'https://passculture.app/accueil',
},
{
label: 'General information',
href: 'https://pass.culture.fr/',
},
],
},
{
title: 'Useful links',
items: [
{
label: 'CGU',
href: 'https://www.notion.so/passcultureapp/Conditions-G-n-rales-d-Utilisation-des-API-pass-Culture-ed6df4e66ed048e292350285319e6d2a',
},
{
label: 'Help Center',
href: 'https://aide.passculture.app/hc/fr',
},
{
label: 'GitHub',
href: 'https://github.com/pass-culture/pass-culture-main',
},
],
},
{
title: 'Follow us',
items: [
{
label: 'LinkedIn',
href: 'https://fr.linkedin.com/company/pass-culture',
},
{
label: 'X',
href: 'https://x.com/pass_Culture',
},
{
label: 'Medium',
href: 'https://medium.com/passcultureofficiel',
},
{
label: 'TikTok',
href: 'https://www.tiktok.com/@passcultureofficiel',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} pass Culture. Built with Docusaurus.`,
},
prism: {
additionalLanguages: ['php', 'json', 'bash'],
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};
export default config;