Skip to content

Commit 447d662

Browse files
committed
fix OverviewPageSlug and remove console logs
1 parent 6f0d79a commit 447d662

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/gatsby-theme/gatsby-node.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)