File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -60,21 +60,19 @@ exports.createPages = async ({ graphql, actions }) => {
6060 if ( node . frontmatter . tutorialTitle ) {
6161 //counts the number of chapters in each tutorial by counting how many files
6262 //there are that contain the overviewpage slug. Subtract one for the overview page.
63- console . log ( data . allMdx . edges . length ) ;
64-
6563 const numberofChapters = data . allMdx . edges . filter ( chapterNode => {
66- // console.log( chapterNode.node.fileAbsolutePath);
67- // console.log( overviewPageSlug);
68- return chapterNode . node . fileAbsolutePath . includes ( overviewPageSlug ) ;
64+ return chapterNode . node . fileAbsolutePath . includes (
65+ ` ${ overviewPageSlug } /` ,
66+ ) ;
6967 } ) ;
7068
7169 const variables = {
7270 gatsbyID : node . frontmatter . id ,
7371 name : node . frontmatter . tutorialTitle ,
7472 numberofChapters : numberofChapters . length - 1 ,
7573 } ;
76-
7774 createPrismaNodes ( variables ) ;
75+
7876 return createPage ( {
7977 path : overviewPageSlug ,
8078 component : overviewTemplate ,
You can’t perform that action at this time.
0 commit comments