File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ const Page = ({ page, section }) => {
23
23
} ) )
24
24
) ;
25
25
26
+ let indexAnchors = [ ] ;
27
+ if ( section . name !== '/' ) {
28
+ indexAnchors = require ( 'page-loader!../../content/' + section . name + '/index.md' ) . attributes . anchors ;
29
+ }
30
+
26
31
return (
27
32
< Container className = "page" >
28
33
< Sponsors />
@@ -32,7 +37,7 @@ const Page = ({ page, section }) => {
32
37
sectionName = { section . name }
33
38
pages = { pages }
34
39
currentPage = { page . url . replace ( '/index' , '' ) }
35
- anchors = { page . file . attributes . anchors } />
40
+ indexAnchors = { indexAnchors } />
36
41
37
42
< section className = "page__content" >
38
43
< 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