From 864e6b3c9d4b2746782dba230db049a8bf9ccd5c Mon Sep 17 00:00:00 2001 From: Rob Ellison Date: Fri, 25 Aug 2023 13:56:50 +0000 Subject: [PATCH] fix: render chapters in the menu --- components/content/ContentPage.jsx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/components/content/ContentPage.jsx b/components/content/ContentPage.jsx index e08e2957..247606b2 100644 --- a/components/content/ContentPage.jsx +++ b/components/content/ContentPage.jsx @@ -252,26 +252,24 @@ function ContentMenu({ content, file, handleContentChange, handlePageReset, cont if (content && content[directory]) { for (let collectionItem of context.collections) { if (content[directory][collectionItem]) { + // console.log('ContentMenu:collectionItem: ', collectionItem) chaptersMenu.push( { - groupTitle: collectionItem.path, + groupTitle: collectionItem, links: content[directory][collectionItem] } ) } } - - - - // if (content[directory].chapters) { - // chaptersMenu.push( - // { - // groupTitle: "Chapters", - // links: content[directory].chapters - // } - // ) - // } + if (content[directory].chapters) { + chaptersMenu.push( + { + groupTitle: "Chapters", + links: content[directory].chapters + } + ) + } // if (content[directory].knowledge) { // chaptersMenu.push( // {