File tree 1 file changed +12
-15
lines changed
1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -19,22 +19,19 @@ import '../sidebar-item/sidebar-item-style';
19
19
import '../logo/logo-style' ;
20
20
21
21
export default props => {
22
- // Retrieve section data
23
- let sections = props . children . props . section . all ( )
24
- . map ( ( { title, url, pages } ) => ( {
25
- title,
26
- url,
27
- pages : pages . map ( ( { title, url } ) => ( {
28
- title : title || url , // XXX: Title shouldn't be coming in as undefined
29
- url
22
+ // Retrieve and clean up section data
23
+ let sections = (
24
+ props . children . props . section . all ( )
25
+ . filter ( section => section . pages . length !== 0 )
26
+ . map ( ( { title, url, pages } ) => ( {
27
+ title,
28
+ url,
29
+ pages : pages . map ( ( { title, url } ) => ( {
30
+ title : title || url , // XXX: Title shouldn't be coming in as undefined
31
+ url
32
+ } ) )
30
33
} ) )
31
- } ) ) ;
32
-
33
- // Rename the root section ("webpack" => "Other") and push it to the end
34
- let rootIndex = sections . findIndex ( section => section . title === 'webpack' ) ;
35
- let rootSection = sections . splice ( rootIndex , 1 ) [ 0 ] ;
36
- rootSection . title = 'Other' ;
37
- sections . push ( rootSection ) ;
34
+ ) ;
38
35
39
36
return (
40
37
< div id = "site" className = "site" >
You can’t perform that action at this time.
0 commit comments