File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,12 +50,37 @@ if (process.env.CI === "true") {
5050const { loadRedirects } = require ( "./src/utils/redirects.js" ) ;
5151
5252exports . createPages = async ( { actions, graphql, reporter } ) => {
53- const { createRedirect } = actions ;
53+ const { createRedirect, createSlice } = actions ;
5454 const redirects = loadRedirects ( ) ;
5555 redirects . forEach ( redirect => createRedirect ( redirect ) ) ; // Handles all hardcoded ones dynamically
5656 // Create Pages
5757 const { createPage } = actions ;
5858
59+ createSlice ( {
60+ id : "site-header" ,
61+ component : path . resolve ( "./src/slices/site-header.js" ) ,
62+ } ) ;
63+
64+ createSlice ( {
65+ id : "site-footer" ,
66+ component : path . resolve ( "./src/slices/site-footer.js" ) ,
67+ } ) ;
68+
69+ createSlice ( {
70+ id : "cta-bottom" ,
71+ component : path . resolve ( "./src/slices/cta-bottom.js" ) ,
72+ } ) ;
73+
74+ createSlice ( {
75+ id : "cta-fullwidth" ,
76+ component : path . resolve ( "./src/slices/cta-fullwidth.js" ) ,
77+ } ) ;
78+
79+ createSlice ( {
80+ id : "cta-imageonly" ,
81+ component : path . resolve ( "./src/slices/cta-imageonly.js" ) ,
82+ } ) ;
83+
5984 const envCreatePage = ( props ) => {
6085 if ( process . env . CI === "true" ) {
6186 const { path, matchPath, ...rest } = props ;
Original file line number Diff line number Diff line change 11import React from "react" ;
22import { MDXProvider } from "@mdx-js/react" ;
33import 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" ;
75import { 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
4947export const wrapRootElement = ( { element } ) => (
Original file line number Diff line number Diff line change 99
1010import React from "react" ;
1111import PropTypes from "prop-types" ;
12+ import { Slice } from "gatsby" ;
1213import ScrollToTopBtn from "./Scrolltotop-button" ;
13- import Navigation from "../sections/General/Navigation" ;
14- import Footer from "../sections/General/Footer" ;
1514// import TopPromotionalBanner from "./TopPromotionalBanner";
1615import { GlobalStyle } from "../sections/app.style" ;
17- import CookieConsent from "./CookieConsent" ;
1816
1917const 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} ;
Original file line number Diff line number Diff line change 11import React from "react" ;
22import { Link } from "gatsby" ;
33import { Container , Row , Col } from "../../../reusecore/Layout" ;
4+ import { useLocation } from "@reach/router" ;
45import logo from "../../../assets/images/layer5/layer5-only/svg/layer5-light-bg.svg" ;
56import SocialLinksColor from "../../../components/SocialLinks-Color" ;
67import Button from "../../../reusecore/Button" ;
78import FooterWrapper from "./footer.style" ;
89import bubblesElement from "./images/bubbles-element.svg" ;
910
10- const Footer = ( { location } ) => {
11+ const Footer = ( { location : locationProp } ) => {
1112 var currentYear = new Date ( ) . getFullYear ( ) ;
13+ const routerLocation = useLocation ( ) ;
14+ const pathname = locationProp ?. pathname || routerLocation ?. pathname || "/" ;
1215
1316 const getUrl = ( pathname ) => {
1417 // remove ".html" that results in live production build
@@ -349,7 +352,7 @@ const Footer = ({ location }) => {
349352 < ul className = "misc-links" >
350353 < li className = "edit-page" >
351354 < a
352- href = { getUrl ( location . pathname ) }
355+ href = { getUrl ( pathname ) }
353356 target = "_blank"
354357 rel = "noreferrer"
355358 >
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import CTA_Bottom from "../components/Call-To-Actions/CTA_Bottom" ;
3+
4+ const CTABottomSlice = ( { sliceContext = { } } ) => < CTA_Bottom { ...sliceContext } /> ;
5+
6+ export default CTABottomSlice ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import CTA_FullWidth from "../components/Call-To-Actions/CTA_FullWidth" ;
3+
4+ const CTAFullWidthSlice = ( { sliceContext = { } } ) => < CTA_FullWidth { ...sliceContext } /> ;
5+
6+ export default CTAFullWidthSlice ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import CTA_ImageOnly from "../components/Call-To-Actions/CTA_ImageOnly" ;
3+
4+ const CTAImageOnlySlice = ( { sliceContext = { } } ) => < CTA_ImageOnly { ...sliceContext } /> ;
5+
6+ export default CTAImageOnlySlice ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import Footer from "../sections/General/Footer" ;
3+
4+ const SiteFooterSlice = ( ) => < Footer /> ;
5+
6+ export default SiteFooterSlice ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import Navigation from "../sections/General/Navigation" ;
3+ import CookieConsent from "../components/CookieConsent" ;
4+
5+ const SiteHeaderSlice = ( ) => (
6+ < >
7+ < Navigation />
8+ < CookieConsent />
9+ </ >
10+ ) ;
11+
12+ export default SiteHeaderSlice ;
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import SEO from "../components/seo";
33
44const LitePlaceholder = ( { pageContext, location } ) => {
55 const {
6- entity = "page" ,
76 heading = "Content disabled in lite mode" ,
87 description = "This route is intentionally skipped when BUILD_FULL_SITE=false." ,
98 } = pageContext ;
You can’t perform that action at this time.
0 commit comments