@openstack_dev/gatsby-theme-marketing-oif-core 1.0.10 → 1.0.12
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/gatsby-config.js +8 -0
- package/gatsby-node.js +0 -3
- package/gatsby-ssr.js +0 -31
- package/netlify-config.yaml +75 -0
- package/netlify.toml +258 -0
- package/package.json +4 -3
- package/plugins/gatsby-plugin-emotion-cache-provider/gatsby-browser.js +9 -0
- package/plugins/gatsby-plugin-emotion-cache-provider/gatsby-ssr.js +36 -0
- package/plugins/gatsby-plugin-emotion-cache-provider/get-emotion-cache.js +5 -0
- package/plugins/gatsby-plugin-emotion-cache-provider/package.json +3 -0
- package/plugins/gatsby-plugin-mui-theme-provider/gatsby-browser.js +3 -0
- package/plugins/gatsby-plugin-mui-theme-provider/gatsby-node.js +43 -0
- package/plugins/gatsby-plugin-mui-theme-provider/gatsby-ssr.js +3 -0
- package/plugins/gatsby-plugin-mui-theme-provider/package.json +3 -0
- package/plugins/gatsby-plugin-mui-theme-provider/wrapThemeProvider.js +13 -0
- package/redirection-rules.js +86 -0
- package/src/components/Layout.js +11 -17
- package/src/content/site-settings/index.json +1 -1
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
18.
|
|
1
|
+
18.20.2
|
package/gatsby-config.js
CHANGED
|
@@ -40,6 +40,13 @@ const manifestPlugin = faviconAsset
|
|
|
40
40
|
: [];
|
|
41
41
|
|
|
42
42
|
const plugins = [
|
|
43
|
+
{
|
|
44
|
+
resolve: "gatsby-plugin-mui-theme-provider",
|
|
45
|
+
options: {
|
|
46
|
+
themePath: `${__dirname}/src/theme.js`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
"gatsby-plugin-emotion-cache-provider",
|
|
43
50
|
...manifestPlugin,
|
|
44
51
|
{
|
|
45
52
|
resolve: "gatsby-alias-imports",
|
|
@@ -47,6 +54,7 @@ const plugins = [
|
|
|
47
54
|
aliases: {
|
|
48
55
|
"@utils": `${__dirname}/src/utils`,
|
|
49
56
|
"@cms": `${__dirname}/src/cms`,
|
|
57
|
+
"@content": `${__dirname}/src/content`,
|
|
50
58
|
},
|
|
51
59
|
},
|
|
52
60
|
},
|
package/gatsby-node.js
CHANGED
|
@@ -140,9 +140,6 @@ exports.onCreateWebpackConfig = ({ actions, plugins }) => {
|
|
|
140
140
|
},
|
|
141
141
|
// allows content and data imports to correctly resolve when theming
|
|
142
142
|
modules: [path.resolve("src")],
|
|
143
|
-
alias: {
|
|
144
|
-
"@utils": path.resolve(__dirname, "src/utils/"),
|
|
145
|
-
},
|
|
146
143
|
},
|
|
147
144
|
// devtool: "source-map",
|
|
148
145
|
plugins: [
|
package/gatsby-ssr.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { JSDOM } from "jsdom";
|
|
3
2
|
import { XMLHttpRequest } from "xmlhttprequest";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { CacheProvider } from "@emotion/react";
|
|
6
|
-
import createEmotionServer from "@emotion/server/create-instance";
|
|
7
3
|
import { ReduxWrapper } from "./src/state/ReduxWrapper";
|
|
8
4
|
import { HeadComponents } from "./src/components/head-components";
|
|
9
|
-
import createEmotionCache from "./src/utils/createEmotionCache";
|
|
10
5
|
|
|
11
6
|
export const onRenderBody = ({ setHeadComponents }) => {
|
|
12
7
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -14,32 +9,6 @@ export const onRenderBody = ({ setHeadComponents }) => {
|
|
|
14
9
|
}
|
|
15
10
|
};
|
|
16
11
|
|
|
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
|
-
|
|
43
12
|
export const wrapRootElement = ReduxWrapper;
|
|
44
13
|
|
|
45
14
|
// 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.12",
|
|
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",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"image-size": "^1.0.1",
|
|
88
88
|
"immutability-helper": "2.9.1",
|
|
89
89
|
"immutable": "^5.0.0-beta.5",
|
|
90
|
+
"js-yaml": "^4.1.0",
|
|
90
91
|
"jsdom": "^16.2.2",
|
|
91
92
|
"lodash": "^4.17.19",
|
|
92
93
|
"lz-string": "^1.4.4",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CacheProvider } from "@emotion/react";
|
|
3
|
+
import getEmotionCache from "./get-emotion-cache";
|
|
4
|
+
|
|
5
|
+
const cache = getEmotionCache();
|
|
6
|
+
|
|
7
|
+
export const wrapRootElement = ({ element }) => (
|
|
8
|
+
<CacheProvider value={cache}>{element}</CacheProvider>
|
|
9
|
+
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CacheProvider } from "@emotion/react";
|
|
3
|
+
import createEmotionServer from "@emotion/server/create-instance";
|
|
4
|
+
import { renderToString } from "react-dom/server";
|
|
5
|
+
|
|
6
|
+
import getEmotionCache from "./get-emotion-cache";
|
|
7
|
+
|
|
8
|
+
export const replaceRenderer = ({
|
|
9
|
+
bodyComponent,
|
|
10
|
+
setHeadComponents,
|
|
11
|
+
replaceBodyHTMLString,
|
|
12
|
+
}) => {
|
|
13
|
+
// see https://mui.com/material-ui/guides/server-rendering/
|
|
14
|
+
const cache = getEmotionCache();
|
|
15
|
+
const { extractCritical } = createEmotionServer(cache);
|
|
16
|
+
|
|
17
|
+
const initialHTML = renderToString(
|
|
18
|
+
<CacheProvider value={cache}>{bodyComponent}</CacheProvider>,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// see https://emotion.sh/docs/ssr#extractcritical
|
|
22
|
+
const { html, css, ids } = extractCritical(initialHTML);
|
|
23
|
+
|
|
24
|
+
const style = (
|
|
25
|
+
<style
|
|
26
|
+
key="theme-styles"
|
|
27
|
+
data-emotion={`css ${ids.join(" ")}`}
|
|
28
|
+
dangerouslySetInnerHTML={{ __html: css }}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
setHeadComponents([style]);
|
|
33
|
+
|
|
34
|
+
// render the result from `extractCritical`
|
|
35
|
+
replaceBodyHTMLString(html);
|
|
36
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
// Copy and past from https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-typography
|
|
5
|
+
exports.onPreBootstrap = ({ cache }, pluginOptions) => {
|
|
6
|
+
let data = "";
|
|
7
|
+
console.log(
|
|
8
|
+
"gatsby-plugin-mui-theme-provider::onPreBootstrap",
|
|
9
|
+
pluginOptions,
|
|
10
|
+
);
|
|
11
|
+
if (pluginOptions.themePath) {
|
|
12
|
+
console.log(
|
|
13
|
+
`gatsby-plugin-mui-theme-provider::onPreBootstrap loading file ${pluginOptions.themePath}`,
|
|
14
|
+
);
|
|
15
|
+
data = fs.readFileSync(pluginOptions.themePath, {
|
|
16
|
+
encoding: "utf8",
|
|
17
|
+
flag: "r",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const dir = cache.directory;
|
|
22
|
+
|
|
23
|
+
if (!fs.existsSync(dir)) {
|
|
24
|
+
fs.mkdirSync(dir);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fs.writeFileSync(path.join(dir, "custom-theme.js"), data);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.onCreateWebpackConfig = ({ actions, cache }) => {
|
|
31
|
+
const themeFile = path.join(cache.directory, "custom-theme.js");
|
|
32
|
+
console.log(
|
|
33
|
+
`gatsby-plugin-mui-theme-provider::onCreateWebpackConfig ${themeFile}`,
|
|
34
|
+
);
|
|
35
|
+
const { setWebpackConfig } = actions;
|
|
36
|
+
setWebpackConfig({
|
|
37
|
+
resolve: {
|
|
38
|
+
alias: {
|
|
39
|
+
"custom-theme": themeFile,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ThemeProvider } from "@mui/material/styles";
|
|
3
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
4
|
+
import theme from "custom-theme";
|
|
5
|
+
// see https://galenwong.github.io/blog/2020-02-27-mui-jss-rendering/
|
|
6
|
+
const wrapThemeProvider = ({ element }) => (
|
|
7
|
+
<ThemeProvider theme={theme}>
|
|
8
|
+
<CssBaseline />
|
|
9
|
+
{element}
|
|
10
|
+
</ThemeProvider>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default wrapThemeProvider;
|
|
@@ -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,14 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
4
|
-
import { ThemeProvider } from "@mui/material/styles";
|
|
5
3
|
import loadable from "@loadable/component";
|
|
6
4
|
import Footer from "./Footer";
|
|
7
5
|
import SponsoredProjectsNav from "./SponsoredProjectsNav";
|
|
8
6
|
import SubscribeForm from "./SubscribeForm";
|
|
9
7
|
import AnnouncementBanner from "./AnnouncementBanner";
|
|
10
8
|
import Header from "./Header";
|
|
11
|
-
import theme from "../theme";
|
|
12
9
|
import NavBarPlaceholder from "./Navbar/placeholder";
|
|
13
10
|
|
|
14
11
|
const Navbar = loadable(() => import("./Navbar"), {
|
|
@@ -18,22 +15,19 @@ const Navbar = loadable(() => import("./Navbar"), {
|
|
|
18
15
|
|
|
19
16
|
function Layout({ children }) {
|
|
20
17
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
18
|
+
<div>
|
|
19
|
+
<SponsoredProjectsNav />
|
|
20
|
+
<Navbar />
|
|
23
21
|
<div>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<SubscribeForm />
|
|
32
|
-
</main>
|
|
33
|
-
<Footer />
|
|
34
|
-
</div>
|
|
22
|
+
<Header />
|
|
23
|
+
<AnnouncementBanner />
|
|
24
|
+
<main id="content-wrapper">
|
|
25
|
+
{children}
|
|
26
|
+
<SubscribeForm />
|
|
27
|
+
</main>
|
|
28
|
+
<Footer />
|
|
35
29
|
</div>
|
|
36
|
-
</
|
|
30
|
+
</div>
|
|
37
31
|
);
|
|
38
32
|
}
|
|
39
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "staticJsonFilesBuildTime": [], "lastBuild":
|
|
1
|
+
{ "staticJsonFilesBuildTime": [], "lastBuild": 1714686144309 }
|