Skip to content

Commit 9b75625

Browse files
committed
Add anchors for index.md, #1085 (Display index pages correctly)
1 parent a6c057f commit 9b75625

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/Page/Page.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const Page = ({ page, section }) => {
3131
component={ Sidebar }
3232
sectionName={ section.name }
3333
pages={ pages }
34-
currentPage={ page.url.replace('/index', '') } />
34+
currentPage={ page.url.replace('/index', '') }
35+
anchors={ page.file.attributes.anchors } />
3536

3637
<section className="page__content">
3738
<h1>{ title }</h1>

src/components/Sidebar/Sidebar.jsx

+3-2
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 } = this.props;
13+
let { sectionName, pages, currentPage, anchors } = this.props;
1414
let { fixed, availableHeight, maxWidth } = this.state;
1515

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

3738
{
3839
pages.map((page, i) =>

0 commit comments

Comments
 (0)