-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
174 lines (159 loc) · 4.43 KB
/
docusaurus.config.js
File metadata and controls
174 lines (159 loc) · 4.43 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
// @ts-check
const { themes: prismThemes } = require('prism-react-renderer');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Zooza Developer Docs',
tagline: 'API and widget integration guides for the Zooza platform',
favicon: 'img/favicon.ico',
url: 'https://docs.zooza.online',
baseUrl: '/',
organizationName: 'zooza',
projectName: 'api-docs',
onBrokenLinks: 'throw',
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
// Defensive gtag stub — prevents `window.gtag is not a function` when
// googletagmanager.com is blocked (ad-blockers, tracking-protection) or
// when the plugin's own bootstrap hasn't run (dev server, stale bundles).
// Idempotent with @docusaurus/plugin-google-gtag's own snippet.
headTags: [
{
tagName: 'script',
attributes: {},
innerHTML:
"window.dataLayer = window.dataLayer || [];" +
"if (typeof window.gtag !== 'function') {" +
" window.gtag = function () { window.dataLayer.push(arguments); };" +
"}",
},
],
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/',
editUrl: undefined,
docItemComponent: '@theme/ApiItem',
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-96E3E87NS0',
anonymizeIP: true,
},
sitemap: {
changefreq: 'weekly',
priority: 0.7,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
},
}),
],
],
plugins: [
[
'docusaurus-plugin-openapi-docs',
{
id: 'zoozaApi',
docsPluginId: 'classic',
config: {
zoozaApi: {
specPath: 'static/zooza_api_v1.yaml',
outputDir: 'docs/api/reference',
sidebarOptions: {
groupPathsBy: 'tag',
categoryLinkSource: 'tag',
},
},
},
},
],
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{ from: '/api/endpoints', to: '/api/reference' },
],
},
],
],
themes: ['docusaurus-theme-openapi-docs', '@docusaurus/theme-mermaid'],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/social-card.png',
navbar: {
title: 'Zooza Docs',
logo: {
alt: 'Zooza',
src: 'img/logo.svg',
srcDark: 'img/logo-dark.svg',
},
items: [
{ to: '/quickstart', label: 'Quickstart', position: 'left' },
{ to: '/widgets', label: 'Widgets', position: 'left' },
{ to: '/api', label: 'API', position: 'left' },
{
href: 'https://zooza.app',
label: 'Go to app',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Documentation',
items: [
{ label: 'Quickstart', to: '/quickstart' },
{ label: 'Concepts', to: '/concepts' },
{ label: 'Widgets', to: '/widgets' },
{ label: 'API Reference', to: '/api' },
{ label: 'Enums', to: '/enums' },
],
},
{
title: 'More',
items: [
{ label: 'Zooza App', href: 'https://zooza.app' },
{ label: 'Zooza Website', href: 'https://zooza.online' },
{ label: 'Support', href: 'mailto:support@zooza.online' },
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Zooza. All rights reserved.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['bash', 'php', 'json'],
},
algolia: {
appId: 'G4L1X5YJDL',
apiKey: '664f30b167ab43a3fe92115ab39c90b6',
indexName: 'Zooza API Docs',
contextualSearch: true,
searchPagePath: 'search',
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
}),
};
module.exports = config;