Browse Source

Explicitly order Main Concepts (#957)

main
Dan Abramov 7 years ago
committed by GitHub
parent
commit
17c50df9d9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      content/docs/nav.yml
  2. 9
      src/templates/components/Sidebar/Section.js

1
content/docs/nav.yml

@ -9,6 +9,7 @@
- id: cdn-links
title: CDN Links
- title: Main Concepts
isOrdered: true
items:
- id: hello-world
title: Hello World

9
src/templates/components/Sidebar/Section.js

@ -69,7 +69,7 @@ class Section extends React.Component {
display: isActive ? 'block' : 'none',
},
}}>
{section.items.map(item => (
{section.items.map((item, index) => (
<li
key={item.id}
css={{
@ -79,7 +79,12 @@ class Section extends React.Component {
isActive: isScrollSync
? activeItemId === item.id
: isItemActive(location, item),
item,
item: section.isOrdered
? {
...item,
title: `${index + 1}. ${item.title}`,
}
: item,
location,
onLinkClick,
section,

Loading…
Cancel
Save