@@ -36,7 +36,6 @@ 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 || { } ) } ;
4039 createPage ( page ) ;
4140
4241 createRedirect ( {
@@ -52,56 +51,14 @@ if (process.env.CI === "true") {
5251
5352const { loadRedirects } = require ( "./src/utils/redirects.js" ) ;
5453
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-
6354exports . createPages = async ( { actions, graphql, reporter } ) => {
64- const { createRedirect, createSlice } = actions ;
55+ const { createRedirect } = actions ;
6556 const redirects = loadRedirects ( ) ;
6657 redirects . forEach ( redirect => createRedirect ( redirect ) ) ; // Handles all hardcoded ones dynamically
6758 // Create Pages
6859 const { createPage } = actions ;
6960
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-
9561 const envCreatePage = ( props ) => {
96- const pageConfig = { ...props } ;
97-
98- if ( isDevelopment ) {
99- pageConfig . defer = true ;
100- } else if ( isProduction ) {
101- pageConfig . mode = "SSR" ;
102- }
103- pageConfig . slices = { ...DEFAULT_SLICES , ...( pageConfig . slices || { } ) } ;
104-
10562 if ( process . env . CI === "true" ) {
10663 const { path, matchPath, ...rest } = pageConfig ;
10764 const isHandbookPage = path . startsWith ( "/community/handbook/" ) ;
@@ -118,7 +75,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
11875 ...rest ,
11976 } ) ;
12077 }
121- return createPage ( pageConfig ) ;
78+ return createPage ( props ) ;
12279 } ;
12380
12481 const blogPostTemplate = path . resolve ( "src/templates/blog-single.js" ) ;
@@ -585,7 +542,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
585542 } ) ;
586543
587544 const components = componentsData . map ( ( component ) => component . src . replace ( "/" , "" ) ) ;
588- const createComponentPages = ( envCreatePage , components ) => {
545+ const createComponentPages = ( createPage , components ) => {
589546 const pageTypes = [
590547 { suffix : "" , file : "index.js" } ,
591548 { suffix : "/guidance" , file : "guidance.js" } ,
@@ -598,7 +555,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
598555 const componentPath = `./src/sections/Projects/Sistent/components/${ name } /${ file } ` ;
599556 if ( fs . existsSync ( path . resolve ( componentPath ) ) ) {
600557 try {
601- envCreatePage ( {
558+ createPage ( {
602559 path : pagePath ,
603560 component : require . resolve ( componentPath ) ,
604561 } ) ;
@@ -612,7 +569,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
612569 } ) ;
613570 } ;
614571
615- createComponentPages ( envCreatePage , components ) ;
572+ createComponentPages ( createPage , components ) ;
616573} ;
617574
618575// slug starts and ends with '/' so parts[0] and parts[-1] will be empty
0 commit comments