-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
227 lines (226 loc) · 6.31 KB
/
docusaurus.config.js
File metadata and controls
227 lines (226 loc) · 6.31 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
const {themes} = require('prism-react-renderer');
module.exports = {
title: 'phpvms Docs',
url: 'https://docs.phpvms.net',
baseUrl: '/',
onBrokenLinks: 'log',
favicon: 'img/favicon.ico',
organizationName: 'phpvms',
projectName: 'docs',
trailingSlash: false,
future: {
faster: true,
},
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
clientModules: [
require.resolve('./src/clientModules/tocBar.js'),
require.resolve('./src/clientModules/mermaidZoom.js'),
require.resolve('./src/clientModules/backToTop.js'),
],
stylesheets: [
{
href: 'https://fonts.googleapis.com/css2?family=Encode+Sans:wght@500;600;700&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&family=Inter:wght@600&family=JetBrains+Mono:wght@400;500;600&display=swap',
type: 'text/css',
},
],
/*
* Defensive gtag shim. The Docusaurus gtag plugin's onRouteDidUpdate
* calls window.gtag('event', 'page_view') unconditionally, but if the
* user runs an adblocker (uBlock Origin, Brave Shields, etc.) the
* plugin's inline GTM bootstrap is stripped, leaving window.gtag
* undefined and producing "gtag is not a function" errors on every
* route change.
*
* Pre-define a no-op `window.gtag` here in headTags so it's
* guaranteed to exist by the time the plugin's client module fires.
* If the real gtag loads (no blocker), it overwrites this stub.
*/
headTags: [
{
tagName: 'script',
attributes: {},
innerHTML: `if(typeof window!=="undefined"&&typeof window.gtag!=="function"){window.gtag=function(){};}`,
},
],
themeConfig: {
imageZoom: {
selector: '.markdown img',
options: {
margin: 24,
background: 'rgba(0, 0, 0, 0.7)',
scrollOffset: 0,
},
},
algolia: {
appId: 'A3V8IXF4VF',
apiKey: '0dc12617e3ca951eb79977c8733b0fe2',
indexName: 'phpvms',
contextualSearch: true,
// Persist user's recent + favorite searches in localStorage so
// returning visitors see "Recent" / "Favorites" sections in the
// DocSearch modal before they start typing. Default is enabled in
// DocSearch v3, but we set it explicitly so future config changes
// don't inadvertently flip it off.
disableUserPersonalization: false,
},
metadata: [
{
name: 'keywords',
content:
'phpvms, vmsacars, virtual airline, virtual airline management system, phpvms documentation, phpvms user guide, phpvms installation guide',
},
],
navbar: {
title: 'phpvms',
logo: {
alt: 'phpvms Logo',
src: 'img/logo_blue.svg',
},
items: [
// {
// href: 'https://forum.phpvms.net',
// label: 'Forum',
// className: 'navbar-forum-link',
// position: 'right',
// },
{
type: 'docsVersionDropdown',
position: 'right',
className: 'navbar-version-pill',
},
{
href: 'https://github.com/phpvms/phpvms',
className: 'header-github-link',
position: 'right',
},
],
},
prism: {
theme: themes.github,
additionalLanguages: ['php', 'bash', 'sql', 'nginx', 'apacheconf'],
},
footer: {
style: 'light',
links: [],
copyright: `Copyright © ${new Date().getFullYear()} phpvms`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
debug: false,
docs: {
// homePageId: 'intro',
path: 'docs',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/phpvms/docs/tree/master/',
disableVersioning: false,
lastVersion: 'v7.x',
versions: {
current: {
label: 'v8.x',
path: '8.x',
banner: 'unreleased',
},
'v7.x': {
label: 'v7.x',
},
},
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-DW1H3QQJ5B',
anonymizeIP: true,
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
},
},
],
],
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
// Legacy path (no longer exists in any version) → v7.x user guide
from: '/acars/install-client',
to: '/acars/user-guide',
},
],
// When v8.x ships as the released version, set the
// PHPVMS_DOCS_V8_RELEASED env var (or flip the default below to
// true) and also change `lastVersion` in the docs preset to 'v8.x'.
// This will rewrite every URL like /8.x/foo to /foo (the new
// canonical root path), keeping legacy /8.x/* links working.
createRedirects(existingPath) {
const v8Released =
process.env.PHPVMS_DOCS_V8_RELEASED === 'true' || false;
if (!v8Released) {
return undefined;
}
// After v8.x is released, the v8 docs live at the site root ('/').
// Map root paths to their /8.x/* equivalents so old links resolve.
if (
existingPath !== '/' &&
!existingPath.startsWith('/v7.x/') &&
!existingPath.startsWith('/8.x/')
) {
return [`/8.x${existingPath}`];
}
return undefined;
},
},
],
[
'@docusaurus/plugin-ideal-image',
{
quality: 70,
max: 400,
min: 200,
steps: 2,
disableInDev: false,
},
],
'plugin-image-zoom',
/*
[
'@docusaurus/plugin-pwa',
{
debug: false,
offlineModeActivationStrategies: [
'appInstalled',
'standalone',
'queryString',
],
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/logo.svg',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json',
},
{
tagName: 'meta',
name: 'theme-color',
content: '#2196f3',
},
],
},
],
*/
],
};