@openstack_dev/gatsby-theme-marketing-oif-core 1.0.9 → 1.0.11
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/gatsby-browser.js +2 -4
- package/gatsby-ssr.js +32 -1
- package/netlify-config.yaml +75 -0
- package/netlify.toml +258 -0
- package/package.json +8 -3
- package/redirection-rules.js +86 -0
- package/src/components/Layout.js +20 -21
- package/src/components/Navbar/index.js +1 -0
- package/src/components/Navbar/placeholder.js +20 -0
- package/src/content/site-settings/index.json +1 -1
- package/src/state/ReduxWrapper.js +13 -2
package/gatsby-browser.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReduxWrapperWithCacheProvider } from "./src/state/ReduxWrapper";
|
|
2
2
|
|
|
3
|
-
export const wrapRootElement =
|
|
4
|
-
|
|
5
|
-
export const onClientEntry = () => {};
|
|
3
|
+
export const wrapRootElement = ReduxWrapperWithCacheProvider;
|
package/gatsby-ssr.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { JSDOM } from "jsdom";
|
|
2
3
|
import { XMLHttpRequest } from "xmlhttprequest";
|
|
3
|
-
import
|
|
4
|
+
import { renderToString } from "react-dom/server";
|
|
5
|
+
import { CacheProvider } from "@emotion/react";
|
|
6
|
+
import createEmotionServer from "@emotion/server/create-instance";
|
|
7
|
+
import { ReduxWrapper } from "./src/state/ReduxWrapper";
|
|
4
8
|
import { HeadComponents } from "./src/components/head-components";
|
|
9
|
+
import createEmotionCache from "./src/utils/createEmotionCache";
|
|
5
10
|
|
|
6
11
|
export const onRenderBody = ({ setHeadComponents }) => {
|
|
7
12
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -9,6 +14,32 @@ export const onRenderBody = ({ setHeadComponents }) => {
|
|
|
9
14
|
}
|
|
10
15
|
};
|
|
11
16
|
|
|
17
|
+
export const replaceRenderer = ({
|
|
18
|
+
bodyComponent,
|
|
19
|
+
setHeadComponents,
|
|
20
|
+
replaceBodyHTMLString,
|
|
21
|
+
}) => {
|
|
22
|
+
const cache = createEmotionCache();
|
|
23
|
+
const { extractCriticalToChunks } = createEmotionServer(cache);
|
|
24
|
+
|
|
25
|
+
const emotionStyles = extractCriticalToChunks(
|
|
26
|
+
renderToString(<CacheProvider value={cache}>{bodyComponent}</CacheProvider>),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
setHeadComponents(
|
|
30
|
+
emotionStyles.styles.map((style) => (
|
|
31
|
+
<style
|
|
32
|
+
data-emotion={`${style.key} ${style.ids.join(" ")}`}
|
|
33
|
+
key={style.key}
|
|
34
|
+
dangerouslySetInnerHTML={{ __html: style.css }}
|
|
35
|
+
/>
|
|
36
|
+
)),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// render the result from `extractCritical`
|
|
40
|
+
replaceBodyHTMLString(emotionStyles.html);
|
|
41
|
+
};
|
|
42
|
+
|
|
12
43
|
export const wrapRootElement = ReduxWrapper;
|
|
13
44
|
|
|
14
45
|
// build enabler polyfills
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
headers:
|
|
2
|
+
- for: /*
|
|
3
|
+
redirects:
|
|
4
|
+
- from: /marketplace/*
|
|
5
|
+
to: /marketplace/
|
|
6
|
+
- from: /themes/*
|
|
7
|
+
to: /themes/
|
|
8
|
+
- from: /navbar/*
|
|
9
|
+
to: /navbar/
|
|
10
|
+
- from: /framework/*
|
|
11
|
+
to: /framework/
|
|
12
|
+
- from: /googlemaps/*
|
|
13
|
+
to: /googlemaps/
|
|
14
|
+
- from: /node_modules/*
|
|
15
|
+
to: /node_modules/
|
|
16
|
+
- from: /maps_images/*
|
|
17
|
+
to: /maps_images/
|
|
18
|
+
- from: /use-cases/*
|
|
19
|
+
to: /use-cases/
|
|
20
|
+
- from: /software/*
|
|
21
|
+
to: /software/
|
|
22
|
+
- from: /openstack-map/*
|
|
23
|
+
to: /openstack-map/
|
|
24
|
+
- from: /surveys/*
|
|
25
|
+
to: /surveys/
|
|
26
|
+
- from: /user-survey/*
|
|
27
|
+
to: /user-survey/
|
|
28
|
+
- from: /blog/*
|
|
29
|
+
to: /blog/
|
|
30
|
+
- from: /marketing/*
|
|
31
|
+
to: /marketing/
|
|
32
|
+
- from: /summit/*
|
|
33
|
+
to: /summit/
|
|
34
|
+
- from: /brand/*
|
|
35
|
+
to: /brand/
|
|
36
|
+
- from: /community/*
|
|
37
|
+
to: /community/
|
|
38
|
+
- from: /events/*
|
|
39
|
+
to: /events/
|
|
40
|
+
- from: /ptg/*
|
|
41
|
+
to: /ptg/
|
|
42
|
+
- from: /videos/*
|
|
43
|
+
to: /videos/
|
|
44
|
+
- from: /summit-video-app/*
|
|
45
|
+
to: /summit-video-app/
|
|
46
|
+
- from: /news/*
|
|
47
|
+
to: /summit-video-app/
|
|
48
|
+
- from: /favicon/*
|
|
49
|
+
to: /favicon/
|
|
50
|
+
- from: /errors_pages/*
|
|
51
|
+
to: /errors_pages/
|
|
52
|
+
- from: /speaker_bureau/*
|
|
53
|
+
to: /speaker_bureau/
|
|
54
|
+
- from: /coa/*
|
|
55
|
+
to: /coa/
|
|
56
|
+
- from: /learn/*
|
|
57
|
+
to: /learn/
|
|
58
|
+
- from: /Security/*
|
|
59
|
+
to: /Security/
|
|
60
|
+
- from: /OpenStackIdAuthenticator/*
|
|
61
|
+
to: /OpenStackIdAuthenticator/
|
|
62
|
+
- from: /profile/*
|
|
63
|
+
to: /profile/
|
|
64
|
+
- from: /userprofile/*
|
|
65
|
+
to: /userprofile/
|
|
66
|
+
- from: /registration/*
|
|
67
|
+
to: /registration/
|
|
68
|
+
- from: /legal/*
|
|
69
|
+
to: /legal/
|
|
70
|
+
- from: /ICLA/*
|
|
71
|
+
to: /ICLA/
|
|
72
|
+
- from: /marketplaceadmin/*
|
|
73
|
+
to: /marketplaceadmin/
|
|
74
|
+
- from: /api/*
|
|
75
|
+
to: /api/
|
package/netlify.toml
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
|
|
2
|
+
[[headers]]
|
|
3
|
+
# Define which paths this specific [[headers]] block will cover.
|
|
4
|
+
for = "/*"
|
|
5
|
+
[headers.values]
|
|
6
|
+
Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI"
|
|
7
|
+
|
|
8
|
+
[[redirects]]
|
|
9
|
+
from = "/marketplace/*"
|
|
10
|
+
to = "https://devbranch.openstack.org/marketplace/:splat"
|
|
11
|
+
status = 200
|
|
12
|
+
force = true
|
|
13
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
14
|
+
|
|
15
|
+
[[redirects]]
|
|
16
|
+
from = "/themes/*"
|
|
17
|
+
to = "https://devbranch.openstack.org/themes/:splat"
|
|
18
|
+
status = 200
|
|
19
|
+
force = true
|
|
20
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
21
|
+
|
|
22
|
+
[[redirects]]
|
|
23
|
+
from = "/navbar/*"
|
|
24
|
+
to = "https://devbranch.openstack.org/navbar/:splat"
|
|
25
|
+
status = 200
|
|
26
|
+
force = true
|
|
27
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
28
|
+
|
|
29
|
+
[[redirects]]
|
|
30
|
+
from = "/framework/*"
|
|
31
|
+
to = "https://devbranch.openstack.org/framework/:splat"
|
|
32
|
+
status = 200
|
|
33
|
+
force = true
|
|
34
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
35
|
+
|
|
36
|
+
[[redirects]]
|
|
37
|
+
from = "/googlemaps/*"
|
|
38
|
+
to = "https://devbranch.openstack.org/googlemaps/:splat"
|
|
39
|
+
status = 200
|
|
40
|
+
force = true
|
|
41
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
42
|
+
|
|
43
|
+
[[redirects]]
|
|
44
|
+
from = "/node_modules/*"
|
|
45
|
+
to = "https://devbranch.openstack.org/node_modules/:splat"
|
|
46
|
+
status = 200
|
|
47
|
+
force = true
|
|
48
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
49
|
+
|
|
50
|
+
[[redirects]]
|
|
51
|
+
from = "/maps_images/*"
|
|
52
|
+
to = "https://devbranch.openstack.org/maps_images/:splat"
|
|
53
|
+
status = 200
|
|
54
|
+
force = true
|
|
55
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
56
|
+
|
|
57
|
+
[[redirects]]
|
|
58
|
+
from = "/use-cases/*"
|
|
59
|
+
to = "https://devbranch.openstack.org/use-cases/:splat"
|
|
60
|
+
status = 200
|
|
61
|
+
force = true
|
|
62
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
63
|
+
|
|
64
|
+
[[redirects]]
|
|
65
|
+
from = "/software/*"
|
|
66
|
+
to = "https://devbranch.openstack.org/software/:splat"
|
|
67
|
+
status = 200
|
|
68
|
+
force = true
|
|
69
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
70
|
+
|
|
71
|
+
[[redirects]]
|
|
72
|
+
from = "/openstack-map/*"
|
|
73
|
+
to = "https://devbranch.openstack.org/openstack-map/:splat"
|
|
74
|
+
status = 200
|
|
75
|
+
force = true
|
|
76
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
77
|
+
|
|
78
|
+
[[redirects]]
|
|
79
|
+
from = "/surveys/*"
|
|
80
|
+
to = "https://devbranch.openstack.org/surveys/:splat"
|
|
81
|
+
status = 200
|
|
82
|
+
force = true
|
|
83
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
84
|
+
|
|
85
|
+
[[redirects]]
|
|
86
|
+
from = "/user-survey/*"
|
|
87
|
+
to = "https://devbranch.openstack.org/user-survey/:splat"
|
|
88
|
+
status = 200
|
|
89
|
+
force = true
|
|
90
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
91
|
+
|
|
92
|
+
[[redirects]]
|
|
93
|
+
from = "/blog/*"
|
|
94
|
+
to = "https://devbranch.openstack.org/blog/:splat"
|
|
95
|
+
status = 200
|
|
96
|
+
force = true
|
|
97
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
98
|
+
|
|
99
|
+
[[redirects]]
|
|
100
|
+
from = "/marketing/*"
|
|
101
|
+
to = "https://devbranch.openstack.org/marketing/:splat"
|
|
102
|
+
status = 200
|
|
103
|
+
force = true
|
|
104
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
105
|
+
|
|
106
|
+
[[redirects]]
|
|
107
|
+
from = "/summit/*"
|
|
108
|
+
to = "https://devbranch.openstack.org/summit/:splat"
|
|
109
|
+
status = 200
|
|
110
|
+
force = true
|
|
111
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
112
|
+
|
|
113
|
+
[[redirects]]
|
|
114
|
+
from = "/brand/*"
|
|
115
|
+
to = "https://devbranch.openstack.org/brand/:splat"
|
|
116
|
+
status = 200
|
|
117
|
+
force = true
|
|
118
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
119
|
+
|
|
120
|
+
[[redirects]]
|
|
121
|
+
from = "/community/*"
|
|
122
|
+
to = "https://devbranch.openstack.org/community/:splat"
|
|
123
|
+
status = 200
|
|
124
|
+
force = true
|
|
125
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
126
|
+
|
|
127
|
+
[[redirects]]
|
|
128
|
+
from = "/events/*"
|
|
129
|
+
to = "https://devbranch.openstack.org/events/:splat"
|
|
130
|
+
status = 200
|
|
131
|
+
force = true
|
|
132
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
133
|
+
|
|
134
|
+
[[redirects]]
|
|
135
|
+
from = "/ptg/*"
|
|
136
|
+
to = "https://devbranch.openstack.org/ptg/:splat"
|
|
137
|
+
status = 200
|
|
138
|
+
force = true
|
|
139
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
140
|
+
|
|
141
|
+
[[redirects]]
|
|
142
|
+
from = "/videos/*"
|
|
143
|
+
to = "https://devbranch.openstack.org/videos/:splat"
|
|
144
|
+
status = 200
|
|
145
|
+
force = true
|
|
146
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
147
|
+
|
|
148
|
+
[[redirects]]
|
|
149
|
+
from = "/summit-video-app/*"
|
|
150
|
+
to = "https://devbranch.openstack.org/summit-video-app/:splat"
|
|
151
|
+
status = 200
|
|
152
|
+
force = true
|
|
153
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
154
|
+
|
|
155
|
+
[[redirects]]
|
|
156
|
+
from = "/news/*"
|
|
157
|
+
to = "https://devbranch.openstack.org/summit-video-app/:splat"
|
|
158
|
+
status = 200
|
|
159
|
+
force = true
|
|
160
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
161
|
+
|
|
162
|
+
[[redirects]]
|
|
163
|
+
from = "/favicon/*"
|
|
164
|
+
to = "https://devbranch.openstack.org/favicon/:splat"
|
|
165
|
+
status = 200
|
|
166
|
+
force = true
|
|
167
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
168
|
+
|
|
169
|
+
[[redirects]]
|
|
170
|
+
from = "/errors_pages/*"
|
|
171
|
+
to = "https://devbranch.openstack.org/errors_pages/:splat"
|
|
172
|
+
status = 200
|
|
173
|
+
force = true
|
|
174
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
175
|
+
|
|
176
|
+
[[redirects]]
|
|
177
|
+
from = "/speaker_bureau/*"
|
|
178
|
+
to = "https://devbranch.openstack.org/speaker_bureau/:splat"
|
|
179
|
+
status = 200
|
|
180
|
+
force = true
|
|
181
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
182
|
+
|
|
183
|
+
[[redirects]]
|
|
184
|
+
from = "/coa/*"
|
|
185
|
+
to = "https://devbranch.openstack.org/coa/:splat"
|
|
186
|
+
status = 200
|
|
187
|
+
force = true
|
|
188
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
189
|
+
|
|
190
|
+
[[redirects]]
|
|
191
|
+
from = "/learn/*"
|
|
192
|
+
to = "https://devbranch.openstack.org/learn/:splat"
|
|
193
|
+
status = 200
|
|
194
|
+
force = true
|
|
195
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
196
|
+
|
|
197
|
+
[[redirects]]
|
|
198
|
+
from = "/Security/*"
|
|
199
|
+
to = "https://devbranch.openstack.org/Security/:splat"
|
|
200
|
+
status = 200
|
|
201
|
+
force = true
|
|
202
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
203
|
+
|
|
204
|
+
[[redirects]]
|
|
205
|
+
from = "/OpenStackIdAuthenticator/*"
|
|
206
|
+
to = "https://devbranch.openstack.org/OpenStackIdAuthenticator/:splat"
|
|
207
|
+
status = 200
|
|
208
|
+
force = true
|
|
209
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
210
|
+
|
|
211
|
+
[[redirects]]
|
|
212
|
+
from = "/profile/*"
|
|
213
|
+
to = "https://devbranch.openstack.org/profile/:splat"
|
|
214
|
+
status = 200
|
|
215
|
+
force = true
|
|
216
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
217
|
+
|
|
218
|
+
[[redirects]]
|
|
219
|
+
from = "/userprofile/*"
|
|
220
|
+
to = "https://devbranch.openstack.org/userprofile/:splat"
|
|
221
|
+
status = 200
|
|
222
|
+
force = true
|
|
223
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
224
|
+
|
|
225
|
+
[[redirects]]
|
|
226
|
+
from = "/registration/*"
|
|
227
|
+
to = "https://devbranch.openstack.org/registration/:splat"
|
|
228
|
+
status = 200
|
|
229
|
+
force = true
|
|
230
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
231
|
+
|
|
232
|
+
[[redirects]]
|
|
233
|
+
from = "/legal/*"
|
|
234
|
+
to = "https://devbranch.openstack.org/legal/:splat"
|
|
235
|
+
status = 200
|
|
236
|
+
force = true
|
|
237
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
238
|
+
|
|
239
|
+
[[redirects]]
|
|
240
|
+
from = "/ICLA/*"
|
|
241
|
+
to = "https://devbranch.openstack.org/ICLA/:splat"
|
|
242
|
+
status = 200
|
|
243
|
+
force = true
|
|
244
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
245
|
+
|
|
246
|
+
[[redirects]]
|
|
247
|
+
from = "/marketplaceadmin/*"
|
|
248
|
+
to = "https://devbranch.openstack.org/marketplaceadmin/:splat"
|
|
249
|
+
status = 200
|
|
250
|
+
force = true
|
|
251
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
|
252
|
+
|
|
253
|
+
[[redirects]]
|
|
254
|
+
from = "/api/*"
|
|
255
|
+
to = "https://devbranch.openstack.org/api/:splat"
|
|
256
|
+
status = 200
|
|
257
|
+
force = true
|
|
258
|
+
headers = {Authorization = "Basic b3BlbnN0YWNrOlF1YWNrZXI", X-From = "netlify", X-Forwarded-Host = "main--oif-marketing-site-dev.netlify.app"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openstack_dev/gatsby-theme-marketing-oif-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Base theme for Marketing Sites",
|
|
5
5
|
"author": "smarcet",
|
|
6
6
|
"keywords": [
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"clean": "find . -name \"node_modules\" -type d -prune -exec rm -rf '{}' + && yarn && yarn gatsby-clean",
|
|
11
11
|
"gatsby-clean": "gatsby clean",
|
|
12
12
|
"start": "npm run develop",
|
|
13
|
-
"build": "NODE_ENV=production NODE_OPTIONS=--max-old-space-size=10240 cross-env node --trace-warnings node_modules/.bin/gatsby build --log-pages",
|
|
14
|
-
"develop": "NODE_OPTIONS=--max-old-space-size=8192 npm run gatsby-clean && node --trace-warnings node_modules/.bin/gatsby develop --S -H 0.0.0.0",
|
|
13
|
+
"build": "NODE_ENV=production node redirection-rules.js && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=10240 cross-env node redirection-rules.js && node --trace-warnings node_modules/.bin/gatsby build --log-pages",
|
|
14
|
+
"develop": "NODE_ENV=development node redirection-rules.js && NODE_OPTIONS=--max-old-space-size=8192 npm run gatsby-clean && node --trace-warnings node_modules/.bin/gatsby develop --S -H 0.0.0.0",
|
|
15
15
|
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",
|
|
16
16
|
"prepare": "husky",
|
|
17
17
|
"lint": "eslint src",
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@emotion/cache": "^11.11.0",
|
|
26
26
|
"@emotion/react": "^11.11.4",
|
|
27
|
+
"@emotion/server": "^11.11.0",
|
|
28
|
+
"@emotion/styled": "^11.11.5",
|
|
27
29
|
"@fortawesome/fontawesome-free": "^6.5.2",
|
|
30
|
+
"@loadable/component": "^5.16.4",
|
|
28
31
|
"@mui/icons-material": "^5.15.15",
|
|
29
32
|
"@mui/material": "^5.15.15",
|
|
30
33
|
"@ncwidgets/file-relation": "^0.8.0",
|
|
@@ -84,6 +87,7 @@
|
|
|
84
87
|
"image-size": "^1.0.1",
|
|
85
88
|
"immutability-helper": "2.9.1",
|
|
86
89
|
"immutable": "^5.0.0-beta.5",
|
|
90
|
+
"js-yaml": "^4.1.0",
|
|
87
91
|
"jsdom": "^16.2.2",
|
|
88
92
|
"lodash": "^4.17.19",
|
|
89
93
|
"lz-string": "^1.4.4",
|
|
@@ -110,6 +114,7 @@
|
|
|
110
114
|
"react-iframe-comm": "^1.2.2",
|
|
111
115
|
"react-immutable-proptypes": "^2.2.0",
|
|
112
116
|
"react-laag": "^2.0.5",
|
|
117
|
+
"react-loadable-visibility": "^3.0.2",
|
|
113
118
|
"react-medium-image-zoom": "^4.3.5",
|
|
114
119
|
"react-redux": "^7.2.6",
|
|
115
120
|
"react-rte": "^0.16.3",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const yaml = require("js-yaml");
|
|
3
|
+
|
|
4
|
+
require("dotenv").config({
|
|
5
|
+
path: `.env.${process.env.NODE_ENV}`,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const NodeType = {
|
|
9
|
+
Header: "header",
|
|
10
|
+
Route: "route",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const tomlNodeExists = (formerToml, nodeType, route) => {
|
|
14
|
+
const key = nodeType === NodeType.Header ? "for" : "from";
|
|
15
|
+
const escapedRoute = route.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16
|
+
const regex = new RegExp(`${key}[\\s]*=[\\s]*"${escapedRoute}"`, "g");
|
|
17
|
+
return regex.test(formerToml);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const buildRedirectionRules = () => {
|
|
21
|
+
const yamlFilePath = `${__dirname}/netlify-config.yaml`;
|
|
22
|
+
const tomlFilePath = `${__dirname}/netlify.toml`;
|
|
23
|
+
|
|
24
|
+
const authToken = process.env.REDIRECTION_RULE_HEADER_AUTH_TOKEN;
|
|
25
|
+
const forwardedHost = process.env.REDIRECTION_RULE_HEADER_X_FORWARDED_HOST;
|
|
26
|
+
const redirectionHost = process.env.REDIRECTION_RULE_HOST;
|
|
27
|
+
|
|
28
|
+
const netlifyConfig = yaml.load(fs.readFileSync(yamlFilePath, "utf8"));
|
|
29
|
+
|
|
30
|
+
let formerToml = null;
|
|
31
|
+
let appendMode = false;
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(tomlFilePath)) {
|
|
34
|
+
formerToml = fs.readFileSync(tomlFilePath, { encoding: "utf8", flag: "r" });
|
|
35
|
+
appendMode = true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let netlifyToml = "";
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < netlifyConfig.headers.length; i++) {
|
|
41
|
+
const header = netlifyConfig.headers[i];
|
|
42
|
+
|
|
43
|
+
if (formerToml && tomlNodeExists(formerToml, NodeType.Header, header.for)) continue;
|
|
44
|
+
|
|
45
|
+
netlifyToml += `
|
|
46
|
+
[[headers]]
|
|
47
|
+
# Define which paths this specific [[headers]] block will cover.
|
|
48
|
+
for = "${header.for}"
|
|
49
|
+
[headers.values]
|
|
50
|
+
Authorization = "Basic ${authToken}"\n`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i < netlifyConfig.redirects.length; i++) {
|
|
54
|
+
const redirect = netlifyConfig.redirects[i];
|
|
55
|
+
|
|
56
|
+
if (formerToml && tomlNodeExists(formerToml, NodeType.Route, redirect.from)) continue;
|
|
57
|
+
|
|
58
|
+
netlifyToml += `
|
|
59
|
+
[[redirects]]
|
|
60
|
+
from = "${redirect.from}"
|
|
61
|
+
to = "${redirectionHost}${redirect.to}:splat"
|
|
62
|
+
status = 200
|
|
63
|
+
force = true
|
|
64
|
+
headers = {Authorization = "Basic ${authToken}", X-From = "netlify", X-Forwarded-Host = "${forwardedHost}"}\n`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!appendMode) {
|
|
68
|
+
console.log("Creating netlify.toml...");
|
|
69
|
+
fs.writeFileSync(tomlFilePath, netlifyToml, (err) => {
|
|
70
|
+
if (err) {
|
|
71
|
+
console.error("Could not write netlify.toml file", err);
|
|
72
|
+
throw err;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
console.log("Appending data to netlify.toml...");
|
|
77
|
+
fs.appendFile(tomlFilePath, netlifyToml, (err) => {
|
|
78
|
+
if (err) {
|
|
79
|
+
console.error("Could not append data to netlify.toml file", err);
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
buildRedirectionRules();
|
package/src/components/Layout.js
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import CssBaseline from "@mui/material/CssBaseline";
|
|
4
|
-
import { CacheProvider } from "@emotion/react";
|
|
5
4
|
import { ThemeProvider } from "@mui/material/styles";
|
|
5
|
+
import loadable from "@loadable/component";
|
|
6
6
|
import Footer from "./Footer";
|
|
7
7
|
import SponsoredProjectsNav from "./SponsoredProjectsNav";
|
|
8
8
|
import SubscribeForm from "./SubscribeForm";
|
|
9
9
|
import AnnouncementBanner from "./AnnouncementBanner";
|
|
10
10
|
import Header from "./Header";
|
|
11
|
-
import Navbar from "./Navbar";
|
|
12
11
|
import theme from "../theme";
|
|
12
|
+
import NavBarPlaceholder from "./Navbar/placeholder";
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const Navbar = loadable(() => import("./Navbar"), {
|
|
15
|
+
ssr: false,
|
|
16
|
+
fallback: <NavBarPlaceholder />,
|
|
17
|
+
});
|
|
17
18
|
|
|
18
19
|
function Layout({ children }) {
|
|
19
20
|
return (
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
21
|
+
<ThemeProvider theme={theme}>
|
|
22
|
+
<CssBaseline />
|
|
23
|
+
<div>
|
|
24
|
+
<SponsoredProjectsNav />
|
|
25
|
+
<Navbar />
|
|
23
26
|
<div>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<SubscribeForm />
|
|
32
|
-
</main>
|
|
33
|
-
<Footer />
|
|
34
|
-
</div>
|
|
27
|
+
<Header />
|
|
28
|
+
<AnnouncementBanner />
|
|
29
|
+
<main id="content-wrapper">
|
|
30
|
+
{children}
|
|
31
|
+
<SubscribeForm />
|
|
32
|
+
</main>
|
|
33
|
+
<Footer />
|
|
35
34
|
</div>
|
|
36
|
-
</
|
|
37
|
-
</
|
|
35
|
+
</div>
|
|
36
|
+
</ThemeProvider>
|
|
38
37
|
);
|
|
39
38
|
}
|
|
40
39
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import AppBar from "@mui/material/AppBar";
|
|
3
|
+
import { Container } from "@mui/material";
|
|
4
|
+
import styles from "./index.module.scss";
|
|
5
|
+
|
|
6
|
+
function NavBarPlaceholder() {
|
|
7
|
+
return (
|
|
8
|
+
<nav role="navigation">
|
|
9
|
+
<AppBar
|
|
10
|
+
position="static"
|
|
11
|
+
className={styles.navbar}
|
|
12
|
+
sx={{ backgroundColor: "#fff", boxShadow: "none" }}
|
|
13
|
+
>
|
|
14
|
+
<Container maxWidth="xl" />
|
|
15
|
+
</AppBar>
|
|
16
|
+
</nav>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default NavBarPlaceholder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "staticJsonFilesBuildTime": [], "lastBuild":
|
|
1
|
+
{ "staticJsonFilesBuildTime": [], "lastBuild": 1713964554954 }
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Provider } from "react-redux";
|
|
3
3
|
import { PersistGate } from "redux-persist/integration/react";
|
|
4
|
+
import { CacheProvider } from "@emotion/react";
|
|
4
5
|
import { store, persistor } from "./store";
|
|
6
|
+
import createEmotionCache from "../utils/createEmotionCache";
|
|
5
7
|
|
|
6
|
-
function ReduxWrapper({ element }) {
|
|
8
|
+
export function ReduxWrapper({ element }) {
|
|
7
9
|
return (
|
|
8
10
|
<Provider store={store}>
|
|
9
11
|
<PersistGate persistor={persistor}>{() => element}</PersistGate>
|
|
@@ -11,4 +13,13 @@ function ReduxWrapper({ element }) {
|
|
|
11
13
|
);
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
export
|
|
16
|
+
export function ReduxWrapperWithCacheProvider({ element }) {
|
|
17
|
+
const cache = createEmotionCache();
|
|
18
|
+
return (
|
|
19
|
+
<CacheProvider value={cache}>
|
|
20
|
+
<Provider store={store}>
|
|
21
|
+
<PersistGate persistor={persistor}>{() => element}</PersistGate>
|
|
22
|
+
</Provider>
|
|
23
|
+
</CacheProvider>
|
|
24
|
+
);
|
|
25
|
+
}
|