Skip to content

Commit ceee05d

Browse files
Merge branch 'master' into handbook-migration
2 parents 37e3432 + 2b62849 commit ceee05d

44 files changed

Lines changed: 137 additions & 47 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gatsby-node.js

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (process.env.CI === "true") {
3434
if (page.path !== oldPage.path) {
3535
// Replace new page with old page
3636
deletePage(oldPage);
37+
page.slices = { ...DEFAULT_SLICES, ...(page.slices || {}) };
3738
createPage(page);
3839

3940
createRedirect({
@@ -49,16 +50,52 @@ if (process.env.CI === "true") {
4950

5051
const { loadRedirects } = require("./src/utils/redirects.js");
5152

53+
const DEFAULT_SLICES = {
54+
"site-header": "site-header",
55+
"site-footer": "site-footer",
56+
"cta-bottom": "cta-bottom",
57+
"cta-fullwidth": "cta-fullwidth",
58+
"cta-imageonly": "cta-imageonly",
59+
};
60+
5261
exports.createPages = async ({ actions, graphql, reporter }) => {
53-
const { createRedirect } = actions;
62+
const { createRedirect, createSlice } = actions;
5463
const redirects = loadRedirects();
5564
redirects.forEach(redirect => createRedirect(redirect)); // Handles all hardcoded ones dynamically
5665
// Create Pages
5766
const { createPage } = actions;
5867

68+
createSlice({
69+
id: "site-header",
70+
component: path.resolve("./src/slices/site-header.js"),
71+
});
72+
73+
createSlice({
74+
id: "site-footer",
75+
component: path.resolve("./src/slices/site-footer.js"),
76+
});
77+
78+
createSlice({
79+
id: "cta-bottom",
80+
component: path.resolve("./src/slices/cta-bottom.js"),
81+
});
82+
83+
createSlice({
84+
id: "cta-fullwidth",
85+
component: path.resolve("./src/slices/cta-fullwidth.js"),
86+
});
87+
88+
createSlice({
89+
id: "cta-imageonly",
90+
component: path.resolve("./src/slices/cta-imageonly.js"),
91+
});
92+
5993
const envCreatePage = (props) => {
94+
const pageConfig = { ...props };
95+
pageConfig.slices = { ...DEFAULT_SLICES, ...(pageConfig.slices || {}) };
96+
6097
if (process.env.CI === "true") {
61-
const { path, matchPath, ...rest } = props;
98+
const { path, matchPath, ...rest } = pageConfig;
6299

63100
createRedirect({
64101
fromPath: `/${path}/`,
@@ -73,7 +110,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
73110
...rest,
74111
});
75112
}
76-
return createPage(props);
113+
return createPage(pageConfig);
77114
};
78115

79116
const blogPostTemplate = path.resolve("src/templates/blog-single.js");
@@ -540,7 +577,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
540577
});
541578

542579
const components = componentsData.map((component) => component.src.replace("/", ""));
543-
const createComponentPages = (createPage, components) => {
580+
const createComponentPages = (envCreatePage, components) => {
544581
const pageTypes = [
545582
{ suffix: "", file: "index.js" },
546583
{ suffix: "/guidance", file: "guidance.js" },
@@ -553,7 +590,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
553590
const componentPath = `./src/sections/Projects/Sistent/components/${name}/${file}`;
554591
if (fs.existsSync(path.resolve(componentPath))) {
555592
try {
556-
createPage({
593+
envCreatePage({
557594
path: pagePath,
558595
component: require.resolve(componentPath),
559596
});
@@ -567,7 +604,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
567604
});
568605
};
569606

570-
createComponentPages(createPage, components);
607+
createComponentPages(envCreatePage, components);
571608
};
572609

573610
// slug starts and ends with '/' so parts[0] and parts[-1] will be empty

root-wrapper.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from "react";
22
import { MDXProvider } from "@mdx-js/react";
33
import Code from "./src/components/CodeBlock";
4-
import CTA_ImageOnly from "./src/components/Call-To-Actions/CTA_ImageOnly";
5-
import CTA_FullWidth from "./src/components/Call-To-Actions/CTA_FullWidth";
6-
import CTA_Bottom from "./src/components/Call-To-Actions/CTA_Bottom";
4+
import { Slice } from "gatsby";
75
import { ContextWrapper } from "./context-wrapper";
86

97
// Custom image component for better CLS scores
@@ -41,9 +39,9 @@ const components = {
4139
}
4240
},
4341
img: OptimizedImage,
44-
CTA_ImageOnly,
45-
CTA_FullWidth,
46-
CTA_Bottom
42+
CTA_ImageOnly: (props) => <Slice alias="cta-imageonly" sliceContext={props} />, // slice to avoid page rebuilds on CTA tweaks
43+
CTA_FullWidth: (props) => <Slice alias="cta-fullwidth" sliceContext={props} />, // slice to avoid page rebuilds on CTA tweaks
44+
CTA_Bottom: (props) => <Slice alias="cta-bottom" sliceContext={props} />
4745
};
4846

4947
export const wrapRootElement = ({ element }) => (

src/assets/brand/bookmarks.pdf

-220 KB
Binary file not shown.

src/assets/brand/brand-guide.pdf

-6.67 MB
Binary file not shown.

src/assets/images/hosting.zip

-1.45 MB
Binary file not shown.
-3.23 KB
Binary file not shown.
-3.38 KB
Binary file not shown.
-3.63 KB
Binary file not shown.
-3.44 KB
Binary file not shown.
-798 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)