Skip to content

Commit e409654

Browse files
committed
Fix anchors again
1 parent e017d16 commit e409654

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/Page/Page.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const Page = ({ page, section }) => {
2323
}))
2424
);
2525

26+
let indexAnchors = require('page-loader!../../content/'+section.name+'/index.md').attributes.anchors;
27+
2628
return (
2729
<Container className="page">
2830
<Sponsors />
@@ -32,7 +34,7 @@ const Page = ({ page, section }) => {
3234
sectionName={ section.name }
3335
pages={ pages }
3436
currentPage={ page.url.replace('/index', '') }
35-
anchors={ page.file.attributes.anchors } />
37+
indexAnchors={ indexAnchors } />
3638

3739
<section className="page__content">
3840
<h1>{ title }</h1>

src/components/Sidebar/Sidebar.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class Sidebar extends Component {
1010
};
1111

1212
render() {
13-
let { sectionName, pages, currentPage, anchors } = this.props;
13+
let { sectionName, pages, currentPage, indexAnchors } = this.props;
1414
let { fixed, availableHeight, maxWidth } = this.state;
1515

1616
return (
@@ -32,8 +32,8 @@ export default class Sidebar extends Component {
3232
<SidebarItem
3333
url={ `/${sectionName}/` }
3434
title="Introduction"
35-
currentPage= { currentPage }
36-
anchors= { anchors } />
35+
currentPage={ currentPage }
36+
anchors={ indexAnchors } />
3737

3838
{
3939
pages.map((page, i) =>

0 commit comments

Comments
 (0)