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 }) => {
60
60
if ( node . frontmatter . tutorialTitle ) {
61
61
//counts the number of chapters in each tutorial by counting how many files
62
62
//there are that contain the overviewpage slug. Subtract one for the overview page.
63
- console . log ( data . allMdx . edges . length ) ;
64
-
65
63
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
+ ) ;
69
67
} ) ;
70
68
71
69
const variables = {
72
70
gatsbyID : node . frontmatter . id ,
73
71
name : node . frontmatter . tutorialTitle ,
74
72
numberofChapters : numberofChapters . length - 1 ,
75
73
} ;
76
-
77
74
createPrismaNodes ( variables ) ;
75
+
78
76
return createPage ( {
79
77
path : overviewPageSlug ,
80
78
component : overviewTemplate ,
You can’t perform that action at this time.
0 commit comments