Skip to content

Commit

Permalink
fix document sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed Jan 5, 2019
1 parent 89eb079 commit 778833b
Show file tree
Hide file tree
Showing 2 changed files with 2,069 additions and 9 deletions.
9 changes: 6 additions & 3 deletions hygen.io/src/components/toc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class TableOfContents extends React.Component {
})

postNodeSections.forEach(section => {
section.sort((a, b) => a.docNumber > b.docNumber)
section.forEach(s => console.log(s.docNumber))
section.sort((a, b) => a.docNumber - b.docNumber)
console.log(section)
})
return postNodeSections
}
Expand All @@ -42,9 +44,10 @@ class TableOfContents extends React.Component {
const sectionDocs = []
section.forEach(node => {
sectionDocs.push(
<DocContainer>
<DocContainer key={node.path}>
<Link to={node.path}>
<OffsetLi
key={node.path}
selected={
this.props.location &&
node.path === this.props.location.pathname
Expand All @@ -57,7 +60,7 @@ class TableOfContents extends React.Component {
)
})
listItems.push(
<li className="section">
<li className="section" key={idx}>
<h5 className="tocHeading docSearch-lvl0">{sectionTitles[idx]}</h5>
<ul className="sectionItems">{sectionDocs}</ul>
</li>
Expand Down
Loading

0 comments on commit 778833b

Please sign in to comment.