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