@@ -17,14 +17,15 @@ const {
1717
1818const HEAVY_COLLECTIONS = new Set ( [ "members" , "integrations" ] ) ;
1919const isFullSiteBuild = process . env . BUILD_FULL_SITE !== "false" ;
20- const shouldIncludeCollection = ( collection ) => isFullSiteBuild || ! HEAVY_COLLECTIONS . has ( collection ) ;
20+ const shouldIncludeCollection = ( collection ) =>
21+ isFullSiteBuild || ! HEAVY_COLLECTIONS . has ( collection ) ;
2122
2223const { loadRedirects } = require ( "./src/utils/redirects.js" ) ;
2324
2425exports . createPages = async ( { actions, graphql, reporter } ) => {
2526 const { createRedirect } = actions ;
2627 const redirects = loadRedirects ( ) ;
27- redirects . forEach ( redirect => createRedirect ( redirect ) ) ; // Handles all hardcoded ones dynamically
28+ redirects . forEach ( ( redirect ) => createRedirect ( redirect ) ) ; // Handles all hardcoded ones dynamically
2829 // Create Pages
2930 const { createPage } = actions ;
3031
@@ -49,7 +50,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
4950
5051 const blogPostTemplate = path . resolve ( "src/templates/blog-single.js" ) ;
5152 const blogCategoryListTemplate = path . resolve (
52- "src/templates/blog-category-list.js"
53+ "src/templates/blog-category-list.js" ,
5354 ) ;
5455 const blogTagListTemplate = path . resolve ( "src/templates/blog-tag-list.js" ) ;
5556
@@ -61,10 +62,8 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
6162
6263 const BookPostTemplate = path . resolve ( "src/templates/book-single.js" ) ;
6364
64- const ProgramPostTemplate = path . resolve ( "src/templates/program-single.js" ) ;
65-
6665 const MultiProgramPostTemplate = path . resolve (
67- "src/templates/program-multiple.js"
66+ "src/templates/program-multiple.js" ,
6867 ) ;
6968
7069 const CareerPostTemplate = path . resolve ( "src/templates/career-single.js" ) ;
@@ -79,7 +78,9 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
7978
8079 const resourcePostTemplate = path . resolve ( "src/templates/resource-single.js" ) ;
8180 const integrationTemplate = path . resolve ( "src/templates/integrations.js" ) ;
82- const LitePlaceholderTemplate = path . resolve ( "src/templates/lite-placeholder.js" ) ;
81+ const LitePlaceholderTemplate = path . resolve (
82+ "src/templates/lite-placeholder.js" ,
83+ ) ;
8384
8485 const memberBioQuery = isFullSiteBuild
8586 ? `
@@ -108,7 +109,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
108109
109110 const HandbookTemplate = path . resolve ( "src/templates/handbook-template.js" ) ;
110111
111-
112112 const res = await graphql ( `
113113 {
114114 allPosts: allMdx(filter: { frontmatter: { published: { eq: true } } }) {
@@ -241,7 +241,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
241241
242242 const handbook = res . data . handbookPages . nodes ;
243243
244-
245244 const singleWorkshop = res . data . singleWorkshop . nodes ;
246245 const labs = res . data . labs . nodes ;
247246
@@ -414,7 +413,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
414413 } ) ;
415414 } ) ;
416415
417-
418416 programs . forEach ( ( program ) => {
419417 envCreatePage ( {
420418 path : `/programs/${ program . frontmatter . programSlug } ` ,
@@ -512,7 +510,9 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
512510 }
513511 } ) ;
514512
515- const components = componentsData . map ( ( component ) => component . src . replace ( "/" , "" ) ) ;
513+ const components = componentsData . map ( ( component ) =>
514+ component . src . replace ( "/" , "" ) ,
515+ ) ;
516516 const createComponentPages = ( createPage , components ) => {
517517 const pageTypes = [
518518 { suffix : "" , file : "index.js" } ,
@@ -534,7 +534,9 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
534534 console . error ( `Error creating page for "${ pagePath } ":` , error ) ;
535535 }
536536 } else {
537- console . info ( `Skipping creating page "${ pagePath } " - file not found: "${ componentPath } "` ) ;
537+ console . info (
538+ `Skipping creating page "${ pagePath } " - file not found: "${ componentPath } "` ,
539+ ) ;
538540 }
539541 } ) ;
540542 } ) ;
@@ -650,7 +652,7 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
650652 case "blog" :
651653 if ( node . frontmatter . published )
652654 slug = `/${ collection } /${ slugify (
653- node . frontmatter . category
655+ node . frontmatter . category ,
654656 ) } /${ slugify ( node . frontmatter . title ) } `;
655657 break ;
656658 case "news" :
@@ -661,11 +663,11 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
661663 case "kanvas-labs" :
662664 slug = `/learn/${ collection } /${ slugify ( node . frontmatter . title ) } ` ;
663665 break ;
664- case "resources" :
665- if ( node . frontmatter . published )
666- slug = `/${ collection } /${ slugify (
667- node . frontmatter . category
668- ) } /${ slugify ( node . frontmatter . title ) } `;
666+ case "resources" :
667+ if ( node . frontmatter . published )
668+ slug = `/${ collection } /${ slugify (
669+ node . frontmatter . category ,
670+ ) } /${ slugify ( node . frontmatter . title ) } `;
669671 break ;
670672 case "members" :
671673 if ( node . frontmatter . published )
@@ -801,11 +803,16 @@ exports.onCreateWebpackConfig = ({ actions, stage, getConfig }) => {
801803 } ) ;
802804
803805 // Reduce memory pressure by disabling sourcemaps in dev and build
804- if ( stage === "develop" || stage === "develop-html" || stage === "build-javascript" || stage === "build-html" ) {
806+ if (
807+ stage === "develop" ||
808+ stage === "develop-html" ||
809+ stage === "build-javascript" ||
810+ stage === "build-html"
811+ ) {
805812 const config = getConfig ( ) ;
806813 config . devtool = false ;
807814 const miniCssExtractPlugin = config . plugins . find (
808- ( plugin ) => plugin . constructor . name === "MiniCssExtractPlugin"
815+ ( plugin ) => plugin . constructor . name === "MiniCssExtractPlugin" ,
809816 ) ;
810817
811818 if ( miniCssExtractPlugin ) {
@@ -882,8 +889,6 @@ exports.createSchemaCustomization = ({ actions }) => {
882889 createTypes ( typeDefs ) ;
883890} ;
884891
885-
886-
887892exports . onPostBuild = async ( { graphql, reporter } ) => {
888893 const result = await graphql ( `
889894 {
@@ -912,4 +917,4 @@ exports.onPostBuild = async ({ graphql, reporter }) => {
912917 // Optionally, write the result to a file for easier inspection
913918 const outputPath = path . resolve ( __dirname , "public" , "query-result.json" ) ;
914919 fs . writeFileSync ( outputPath , JSON . stringify ( result , null , 2 ) ) ;
915- } ;
920+ } ;
0 commit comments