@@ -55,7 +55,7 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
5555
5656 useEffect ( ( ) => {
5757 let bookmarkPath = localStorage . getItem ( "bookmarkpath-" + course . fields . slug . split ( "/" ) [ 3 ] ) ;
58- if ( bookmarkPath ) {
58+ if ( bookmarkPath ) {
5959 setHasBookmark ( true ) ;
6060 setBookmarkUrl ( bookmarkPath ) ;
6161 }
@@ -64,7 +64,7 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
6464 return (
6565 < CourseOverviewWrapper >
6666 < div className = "course-back-btn" >
67- < Link to = { ` /learn/learning-paths/${ course . fields . learnpath } ` } >
67+ < Link to = { " /learn/learning-paths/${course.fields.learnpath}" } >
6868 < IoChevronBackOutline /> < h4 > Learning Paths/Courses</ h4 >
6969 </ Link >
7070 </ div >
@@ -88,12 +88,12 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
8888 </ div >
8989 < Button
9090 title = { hasBookmark ? "Start Again" : "Get Started" }
91- $url = { ` ${ extractedSection } /${ course . frontmatter . toc [ 0 ] } ` }
91+ $url = { getChapterTitle ( course . frontmatter . toc [ 0 ] , chapters ) ? " /${getChapterTitle( course.frontmatter.toc[0], chapters).fields.slug}" : "#" }
9292 />
9393 { hasBookmark && (
9494 < Button
9595 className = "start-again-button"
96- $primary title = "Resume"
96+ $primary title = "Resume"
9797 $url = { bookmarkUrl }
9898 />
9999 ) }
@@ -113,20 +113,27 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
113113 { children }
114114 </ SRLWrapper >
115115 < h2 className = "course-toc" > Table Of Contents</ h2 >
116- { course . frontmatter . toc . map ( ( item , index ) => (
117- < Link key = { index } to = { `${ extractedSection } /${ item } ` } className = "chapter-link" >
118- < ChapterCard
119- chapterNum = { index + 1 }
120- chapter = { getChapterTitle ( item , chapters ) }
121- />
122- </ Link >
123- ) ) }
116+ { course . frontmatter . toc . map ( ( item , index ) => {
117+ const chapterNode = getChapterTitle ( item , chapters ) ;
118+ return (
119+ < Link
120+ key = { index }
121+ to = { chapterNode ? "/${chapterNode.fields.slug}" : "#" }
122+ className = "chapter-link"
123+ >
124+ < ChapterCard
125+ chapterNum = { index + 1 }
126+ chapter = { chapterNode }
127+ />
128+ </ Link >
129+ ) ;
130+ } ) }
124131 </ Col >
125132 < Col $md = { 12 } $lg = { 4 } $xl = { 5 } >
126133 < div className = "service-meshes-you-can-learn" >
127- { console . log ( "lenght of the service mesh array: " , availableServiceMeshes . length ) }
128- { console . log ( "array: " , availableServiceMeshes ) }
129- { serviceMeshImages . length !== 0 && availableServiceMeshes . length != 0 && (
134+ { console . log ( "lenght of the service mesh array: " , availableServiceMeshes . length ) }
135+ { console . log ( "array: " , availableServiceMeshes ) }
136+ { serviceMeshImages . length !== 0 && availableServiceMeshes . length != 0 && (
130137 < >
131138 < h2 > Technologies You Can Learn</ h2 >
132139 < ServiceMeshesAvailable serviceMeshes = { availableServiceMeshes } />
@@ -145,7 +152,7 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
145152 < SubscribeLearnPath />
146153 </ Col >
147154 </ Row >
148- </ div >
155+ </ div > f
149156 < BookmarkNotification showNotification = { showNotification } closeNotification = { ( ) => setShowNotification ( false ) } />
150157 </ CourseOverviewWrapper >
151158 ) ;
0 commit comments