Skip to content

Commit 51993b8

Browse files
authored
Merge branch 'master' into leecalcote/chore/full-site
Signed-off-by: Lee Calcote <leecalcote@gmail.com>
2 parents e12d4b0 + aac8da5 commit 51993b8

19 files changed

Lines changed: 91 additions & 25 deletions

File tree

gatsby-node.js

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if (process.env.CI === "true") {
3636
if (page.path !== oldPage.path) {
3737
// Replace new page with old page
3838
deletePage(oldPage);
39+
page.slices = { ...DEFAULT_SLICES, ...(page.slices || {}) };
3940
createPage(page);
4041

4142
createRedirect({
@@ -51,13 +52,46 @@ if (process.env.CI === "true") {
5152

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

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

70+
createSlice({
71+
id: "site-header",
72+
component: path.resolve("./src/slices/site-header.js"),
73+
});
74+
75+
createSlice({
76+
id: "site-footer",
77+
component: path.resolve("./src/slices/site-footer.js"),
78+
});
79+
80+
createSlice({
81+
id: "cta-bottom",
82+
component: path.resolve("./src/slices/cta-bottom.js"),
83+
});
84+
85+
createSlice({
86+
id: "cta-fullwidth",
87+
component: path.resolve("./src/slices/cta-fullwidth.js"),
88+
});
89+
90+
createSlice({
91+
id: "cta-imageonly",
92+
component: path.resolve("./src/slices/cta-imageonly.js"),
93+
});
94+
6195
const envCreatePage = (props) => {
6296
const pageConfig = { ...props };
6397

@@ -66,6 +100,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
66100
} else if (isProduction) {
67101
pageConfig.mode = "SSR";
68102
}
103+
pageConfig.slices = { ...DEFAULT_SLICES, ...(pageConfig.slices || {}) };
69104

70105
if (process.env.CI === "true") {
71106
const { path, matchPath, ...rest } = pageConfig;
@@ -520,7 +555,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
520555
});
521556

522557
const components = componentsData.map((component) => component.src.replace("/", ""));
523-
const createComponentPages = (createPage, components) => {
558+
const createComponentPages = (envCreatePage, components) => {
524559
const pageTypes = [
525560
{ suffix: "", file: "index.js" },
526561
{ suffix: "/guidance", file: "guidance.js" },
@@ -533,7 +568,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
533568
const componentPath = `./src/sections/Projects/Sistent/components/${name}/${file}`;
534569
if (fs.existsSync(path.resolve(componentPath))) {
535570
try {
536-
createPage({
571+
envCreatePage({
537572
path: pagePath,
538573
component: require.resolve(componentPath),
539574
});

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.
-2.22 MB
Binary file not shown.
-22.3 MB
Binary file not shown.
-2.48 MB
Binary file not shown.

src/assets/video/meshery/meshmap/touch

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/layout.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,21 @@
99

1010
import React from "react";
1111
import PropTypes from "prop-types";
12+
import { Slice } from "gatsby";
1213
import ScrollToTopBtn from "./Scrolltotop-button";
13-
import Navigation from "../sections/General/Navigation";
14-
import Footer from "../sections/General/Footer";
1514
// import TopPromotionalBanner from "./TopPromotionalBanner";
1615
import { GlobalStyle } from "../sections/app.style";
17-
import CookieConsent from "./CookieConsent";
1816

1917
const Layout = ({ children }) => {
2018

2119
return (
2220
<>
2321
<GlobalStyle />
2422
{/* <TopPromotionalBanner /> */}
25-
<Navigation/>
26-
<CookieConsent />
23+
<Slice alias="site-header" />
2724
{children}
2825
<ScrollToTopBtn />
29-
<Footer location={children.props.location} />
26+
<Slice alias="site-footer" />
3027
</>
3128
);
3229
};

src/sections/Company/Brand/Brand-components/brand-guide.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import styled from "styled-components";
33
import Button from "../../../../reusecore/Button";
44
import BrandGuideImg from "../../../../assets/images/Brand-Guide/brand-guide.webp";
5-
import BrandGuidePDF from "../../../../assets/brand/brand-guide.pdf";
65

76
import { Row, Col } from "../../../../reusecore/Layout";
87
import { FiDownloadCloud } from "@react-icons/all-files/fi/FiDownloadCloud";
@@ -46,7 +45,7 @@ const BrandGuide = () => {
4645
<Row>
4746
<Col $xs={12}>
4847
<Row className="bookmarks">
49-
<Link to={BrandGuidePDF}>
48+
<Link to="/brand/brand-guide.pdf">
5049
<img className="bookmarks" src={BrandGuideImg} alt="Layer5 Brand Guide" />
5150
</Link>
5251
</Row>

0 commit comments

Comments
 (0)