File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ const Page = ({ page, section }) => {
23
23
} ) )
24
24
) ;
25
25
26
+ let indexAnchors = [ ] ;
27
+ if ( section . name !== '/' ) {
28
+ console . log ( section . name ) ;
29
+ indexAnchors = require ( 'page-loader!../../content/' + section . name + '/index.md' ) . attributes . anchors ;
30
+ }
31
+
26
32
return (
27
33
< Container className = "page" >
28
34
< Sponsors />
@@ -32,7 +38,7 @@ const Page = ({ page, section }) => {
32
38
sectionName = { section . name }
33
39
pages = { pages }
34
40
currentPage = { page . url . replace ( '/index' , '' ) }
35
- anchors = { page . file . attributes . anchors } />
41
+ indexAnchors = { indexAnchors } />
36
42
37
43
< section className = "page__content" >
38
44
< h1 > { title } </ h1 >
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default class Sidebar extends Component {
10
10
} ;
11
11
12
12
render ( ) {
13
- let { sectionName, pages, currentPage, anchors } = this . props ;
13
+ let { sectionName, pages, currentPage, indexAnchors } = this . props ;
14
14
let { fixed, availableHeight, maxWidth } = this . state ;
15
15
16
16
return (
@@ -32,8 +32,8 @@ export default class Sidebar extends Component {
32
32
< SidebarItem
33
33
url = { `/${ sectionName } /` }
34
34
title = "Introduction"
35
- currentPage = { currentPage }
36
- anchors = { anchors } />
35
+ currentPage = { currentPage }
36
+ anchors = { indexAnchors } />
37
37
38
38
{
39
39
pages . map ( ( page , i ) =>
You can’t perform that action at this time.
0 commit comments