@openstack_dev/gatsby-theme-marketing-oif-core 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -1
- package/netlify.toml +256 -4
- package/package.json +1 -1
- package/redirection-rules.js +47 -16
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
20.19.4
|
package/netlify.toml
CHANGED
|
@@ -3,11 +3,263 @@
|
|
|
3
3
|
# Define which paths this specific [[headers]] block will cover.
|
|
4
4
|
for = "/*"
|
|
5
5
|
[headers.values]
|
|
6
|
-
Authorization = "Basic
|
|
6
|
+
Authorization = "Basic undefined"
|
|
7
7
|
|
|
8
8
|
[[redirects]]
|
|
9
|
-
from = "/
|
|
10
|
-
to = "
|
|
9
|
+
from = "/marketplace/*"
|
|
10
|
+
to = "undefined/marketplace/:splat"
|
|
11
11
|
status = 200
|
|
12
12
|
force = true
|
|
13
|
-
headers = {Authorization = "Basic
|
|
13
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
14
|
+
|
|
15
|
+
[[redirects]]
|
|
16
|
+
from = "/themes/*"
|
|
17
|
+
to = "undefined/themes/:splat"
|
|
18
|
+
status = 200
|
|
19
|
+
force = true
|
|
20
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
21
|
+
|
|
22
|
+
[[redirects]]
|
|
23
|
+
from = "/navbar/*"
|
|
24
|
+
to = "undefined/navbar/:splat"
|
|
25
|
+
status = 200
|
|
26
|
+
force = true
|
|
27
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
28
|
+
|
|
29
|
+
[[redirects]]
|
|
30
|
+
from = "/framework/*"
|
|
31
|
+
to = "undefined/framework/:splat"
|
|
32
|
+
status = 200
|
|
33
|
+
force = true
|
|
34
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
35
|
+
|
|
36
|
+
[[redirects]]
|
|
37
|
+
from = "/googlemaps/*"
|
|
38
|
+
to = "undefined/googlemaps/:splat"
|
|
39
|
+
status = 200
|
|
40
|
+
force = true
|
|
41
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
42
|
+
|
|
43
|
+
[[redirects]]
|
|
44
|
+
from = "/node_modules/*"
|
|
45
|
+
to = "undefined/node_modules/:splat"
|
|
46
|
+
status = 200
|
|
47
|
+
force = true
|
|
48
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
49
|
+
|
|
50
|
+
[[redirects]]
|
|
51
|
+
from = "/maps_images/*"
|
|
52
|
+
to = "undefined/maps_images/:splat"
|
|
53
|
+
status = 200
|
|
54
|
+
force = true
|
|
55
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
56
|
+
|
|
57
|
+
[[redirects]]
|
|
58
|
+
from = "/use-cases/*"
|
|
59
|
+
to = "undefined/use-cases/:splat"
|
|
60
|
+
status = 200
|
|
61
|
+
force = true
|
|
62
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
63
|
+
|
|
64
|
+
[[redirects]]
|
|
65
|
+
from = "/software/*"
|
|
66
|
+
to = "undefined/software/:splat"
|
|
67
|
+
status = 200
|
|
68
|
+
force = true
|
|
69
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
70
|
+
|
|
71
|
+
[[redirects]]
|
|
72
|
+
from = "/openstack-map/*"
|
|
73
|
+
to = "undefined/openstack-map/:splat"
|
|
74
|
+
status = 200
|
|
75
|
+
force = true
|
|
76
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
77
|
+
|
|
78
|
+
[[redirects]]
|
|
79
|
+
from = "/surveys/*"
|
|
80
|
+
to = "undefined/surveys/:splat"
|
|
81
|
+
status = 200
|
|
82
|
+
force = true
|
|
83
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
84
|
+
|
|
85
|
+
[[redirects]]
|
|
86
|
+
from = "/user-survey/*"
|
|
87
|
+
to = "undefined/user-survey/:splat"
|
|
88
|
+
status = 200
|
|
89
|
+
force = true
|
|
90
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
91
|
+
|
|
92
|
+
[[redirects]]
|
|
93
|
+
from = "/blog/*"
|
|
94
|
+
to = "undefined/blog/:splat"
|
|
95
|
+
status = 200
|
|
96
|
+
force = true
|
|
97
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
98
|
+
|
|
99
|
+
[[redirects]]
|
|
100
|
+
from = "/marketing/*"
|
|
101
|
+
to = "undefined/marketing/:splat"
|
|
102
|
+
status = 200
|
|
103
|
+
force = true
|
|
104
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
105
|
+
|
|
106
|
+
[[redirects]]
|
|
107
|
+
from = "/summit/*"
|
|
108
|
+
to = "undefined/summit/:splat"
|
|
109
|
+
status = 200
|
|
110
|
+
force = true
|
|
111
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
112
|
+
|
|
113
|
+
[[redirects]]
|
|
114
|
+
from = "/brand/*"
|
|
115
|
+
to = "undefined/brand/:splat"
|
|
116
|
+
status = 200
|
|
117
|
+
force = true
|
|
118
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
119
|
+
|
|
120
|
+
[[redirects]]
|
|
121
|
+
from = "/community/*"
|
|
122
|
+
to = "undefined/community/:splat"
|
|
123
|
+
status = 200
|
|
124
|
+
force = true
|
|
125
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
126
|
+
|
|
127
|
+
[[redirects]]
|
|
128
|
+
from = "/events/*"
|
|
129
|
+
to = "undefined/events/:splat"
|
|
130
|
+
status = 200
|
|
131
|
+
force = true
|
|
132
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
133
|
+
|
|
134
|
+
[[redirects]]
|
|
135
|
+
from = "/ptg/*"
|
|
136
|
+
to = "undefined/ptg/:splat"
|
|
137
|
+
status = 200
|
|
138
|
+
force = true
|
|
139
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
140
|
+
|
|
141
|
+
[[redirects]]
|
|
142
|
+
from = "/videos/*"
|
|
143
|
+
to = "undefined/videos/:splat"
|
|
144
|
+
status = 200
|
|
145
|
+
force = true
|
|
146
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
147
|
+
|
|
148
|
+
[[redirects]]
|
|
149
|
+
from = "/summit-video-app/*"
|
|
150
|
+
to = "undefined/summit-video-app/:splat"
|
|
151
|
+
status = 200
|
|
152
|
+
force = true
|
|
153
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
154
|
+
|
|
155
|
+
[[redirects]]
|
|
156
|
+
from = "/news/*"
|
|
157
|
+
to = "undefined/summit-video-app/:splat"
|
|
158
|
+
status = 200
|
|
159
|
+
force = true
|
|
160
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
161
|
+
|
|
162
|
+
[[redirects]]
|
|
163
|
+
from = "/favicon/*"
|
|
164
|
+
to = "undefined/favicon/:splat"
|
|
165
|
+
status = 200
|
|
166
|
+
force = true
|
|
167
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
168
|
+
|
|
169
|
+
[[redirects]]
|
|
170
|
+
from = "/errors_pages/*"
|
|
171
|
+
to = "undefined/errors_pages/:splat"
|
|
172
|
+
status = 200
|
|
173
|
+
force = true
|
|
174
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
175
|
+
|
|
176
|
+
[[redirects]]
|
|
177
|
+
from = "/speaker_bureau/*"
|
|
178
|
+
to = "undefined/speaker_bureau/:splat"
|
|
179
|
+
status = 200
|
|
180
|
+
force = true
|
|
181
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
182
|
+
|
|
183
|
+
[[redirects]]
|
|
184
|
+
from = "/coa/*"
|
|
185
|
+
to = "undefined/coa/:splat"
|
|
186
|
+
status = 200
|
|
187
|
+
force = true
|
|
188
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
189
|
+
|
|
190
|
+
[[redirects]]
|
|
191
|
+
from = "/learn/*"
|
|
192
|
+
to = "undefined/learn/:splat"
|
|
193
|
+
status = 200
|
|
194
|
+
force = true
|
|
195
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
196
|
+
|
|
197
|
+
[[redirects]]
|
|
198
|
+
from = "/Security/*"
|
|
199
|
+
to = "undefined/Security/:splat"
|
|
200
|
+
status = 200
|
|
201
|
+
force = true
|
|
202
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
203
|
+
|
|
204
|
+
[[redirects]]
|
|
205
|
+
from = "/OpenStackIdAuthenticator/*"
|
|
206
|
+
to = "undefined/OpenStackIdAuthenticator/:splat"
|
|
207
|
+
status = 200
|
|
208
|
+
force = true
|
|
209
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
210
|
+
|
|
211
|
+
[[redirects]]
|
|
212
|
+
from = "/profile/*"
|
|
213
|
+
to = "undefined/profile/:splat"
|
|
214
|
+
status = 200
|
|
215
|
+
force = true
|
|
216
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
217
|
+
|
|
218
|
+
[[redirects]]
|
|
219
|
+
from = "/userprofile/*"
|
|
220
|
+
to = "undefined/userprofile/:splat"
|
|
221
|
+
status = 200
|
|
222
|
+
force = true
|
|
223
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
224
|
+
|
|
225
|
+
[[redirects]]
|
|
226
|
+
from = "/registration/*"
|
|
227
|
+
to = "undefined/registration/:splat"
|
|
228
|
+
status = 200
|
|
229
|
+
force = true
|
|
230
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
231
|
+
|
|
232
|
+
[[redirects]]
|
|
233
|
+
from = "/legal/*"
|
|
234
|
+
to = "undefined/legal/:splat"
|
|
235
|
+
status = 200
|
|
236
|
+
force = true
|
|
237
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
238
|
+
|
|
239
|
+
[[redirects]]
|
|
240
|
+
from = "/ICLA/*"
|
|
241
|
+
to = "undefined/ICLA/:splat"
|
|
242
|
+
status = 200
|
|
243
|
+
force = true
|
|
244
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
245
|
+
|
|
246
|
+
[[redirects]]
|
|
247
|
+
from = "/marketplaceadmin/*"
|
|
248
|
+
to = "undefined/marketplaceadmin/:splat"
|
|
249
|
+
status = 200
|
|
250
|
+
force = true
|
|
251
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
252
|
+
|
|
253
|
+
[[redirects]]
|
|
254
|
+
from = "/api/*"
|
|
255
|
+
to = "undefined/api/:splat"
|
|
256
|
+
status = 200
|
|
257
|
+
force = true
|
|
258
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
|
259
|
+
|
|
260
|
+
[[redirects]]
|
|
261
|
+
from = "/community"
|
|
262
|
+
to = "undefined/community"
|
|
263
|
+
status = 200
|
|
264
|
+
force = true
|
|
265
|
+
headers = {Authorization = "Basic undefined", X-From = "netlify", X-Forwarded-Host = "undefined"}
|
package/package.json
CHANGED
package/redirection-rules.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const yaml = require("js-yaml");
|
|
3
3
|
|
|
4
|
+
const HTTP_301 = 301;
|
|
5
|
+
const HTTP_200 = 200;
|
|
6
|
+
const BASE_10 = 10;
|
|
7
|
+
|
|
4
8
|
require("dotenv").config({
|
|
5
|
-
path: `.env.${process.env.NODE_ENV}
|
|
9
|
+
path: `.env.${process.env.NODE_ENV}`
|
|
6
10
|
});
|
|
7
11
|
|
|
8
12
|
const NodeType = {
|
|
9
13
|
Header: "header",
|
|
10
|
-
Route: "route"
|
|
14
|
+
Route: "route"
|
|
11
15
|
};
|
|
12
16
|
|
|
13
17
|
const tomlNodeExists = (formerToml, nodeType, route) => {
|
|
@@ -36,33 +40,60 @@ const buildRedirectionRules = () => {
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
let netlifyToml = "";
|
|
43
|
+
if (netlifyConfig?.headers?.length > 0) {
|
|
44
|
+
for (let i = 0; i < netlifyConfig.headers.length; i++) {
|
|
45
|
+
const header = netlifyConfig.headers[i];
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (formerToml && tomlNodeExists(formerToml, NodeType.Header, header.for)) continue;
|
|
47
|
+
if (formerToml && tomlNodeExists(formerToml, NodeType.Header, header.for))
|
|
48
|
+
continue;
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
netlifyToml += `
|
|
46
51
|
[[headers]]
|
|
47
52
|
# Define which paths this specific [[headers]] block will cover.
|
|
48
53
|
for = "${header.for}"
|
|
49
54
|
[headers.values]
|
|
50
55
|
Authorization = "Basic ${authToken}"\n`;
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
if (netlifyConfig?.redirects?.length > 0) {
|
|
60
|
+
for (let i = 0; i < netlifyConfig.redirects.length; i++) {
|
|
61
|
+
const redirect = netlifyConfig.redirects[i];
|
|
62
|
+
// see https://docs.netlify.com/routing/redirects/redirect-options/#splats
|
|
63
|
+
const hasSplat = redirect.from.endsWith("*");
|
|
64
|
+
if (
|
|
65
|
+
formerToml &&
|
|
66
|
+
tomlNodeExists(formerToml, NodeType.Route, redirect.from)
|
|
67
|
+
)
|
|
68
|
+
continue;
|
|
69
|
+
|
|
70
|
+
const httpRegExp = /^https?:\/\//;
|
|
71
|
+
const isAbsolute = httpRegExp.test(redirect.to);
|
|
72
|
+
const host = isAbsolute ? "" : redirectionHost;
|
|
73
|
+
|
|
74
|
+
// Status code logic correction:
|
|
75
|
+
// 200 for regular redirects (within the same site): for backward compatibility below v1.1.0
|
|
76
|
+
// 301 for absolute URLs (external redirects): permanent redirect
|
|
77
|
+
// If status is provided and is a valid number, has precedence over defaultStatus
|
|
78
|
+
const defaultStatus = isAbsolute ? HTTP_301 : HTTP_200;
|
|
79
|
+
const parsedStatus = parseInt(redirect.status, BASE_10);
|
|
80
|
+
const status = !Number.isNaN(parsedStatus) ? parsedStatus : defaultStatus;
|
|
81
|
+
const headers = [
|
|
82
|
+
"X-From = \"netlify\"",
|
|
83
|
+
`X-Forwarded-Host = "${forwardedHost}"`
|
|
84
|
+
];
|
|
85
|
+
if (!isAbsolute) {
|
|
86
|
+
headers.unshift(`Authorization = "Basic ${authToken}"`);
|
|
87
|
+
}
|
|
58
88
|
|
|
59
|
-
|
|
89
|
+
netlifyToml += `
|
|
60
90
|
[[redirects]]
|
|
61
91
|
from = "${redirect.from}"
|
|
62
|
-
to = "${
|
|
63
|
-
status =
|
|
92
|
+
to = "${host}${redirect.to}${hasSplat ? ":splat" : ""}"
|
|
93
|
+
status = ${status}
|
|
64
94
|
force = true
|
|
65
|
-
headers = {
|
|
95
|
+
headers = {${headers.join(", ")}}\n`;
|
|
96
|
+
}
|
|
66
97
|
}
|
|
67
98
|
|
|
68
99
|
if (!appendMode) {
|