10
10
// Service Docs
11
11
if paths[0 ] === ' services' && paths[1 ]
12
12
- items = hierarchy .findByPath (' /' + paths[0 ] + ' /' + paths[1 ])
13
- - var servicesDropdown = items .children .filter (x => semverService .test (x .id ))
14
- - dropdown = servicesDropdown
13
+ - var versioned = items .children .reduce ((acc , x ) => acc + semverService .test (x .id ), false )
15
14
- service = hierarchy .findByPath (' /' + paths[0 ] + ' /' + paths[1 ])
16
- if paths[ 2 ] && semverService . test (paths[ 2 ])
15
+ if versioned
17
16
- versionTitle = paths[2 ]
18
- - items = hierarchy .findByPath (' /' + paths[0 ] + ' /' + paths[1 ] + ' /' + paths[2 ])
17
+ if ! semverService .test (paths[2 ])
18
+ - versionTitle = navigationTitle || title
19
+ - dropdown = service .children
20
+ - tmpItems = hierarchy .findByPath (' /' + paths[0 ] + ' /' + paths[1 ] + ' /' + paths[2 ])
21
+ if tmpItems
22
+ - items = tmpItems
19
23
20
24
// DC/OS Docs
21
25
if semver .test (paths[0 ])
@@ -34,7 +38,7 @@ mixin renderSidebarHeader()
34
38
each val, index in dropdown
35
39
if val .navigationTitle || val .title
36
40
li( class ='sidebar__dropdown__item' )
37
- a( href =val .path , class ='sidebar__dropdown__link' ) != val .navigationTitle
41
+ a( href =val .path , class ='sidebar__dropdown__link' ) != val .navigationTitle || val . title
38
42
div( class ='sidebar__dropdown__toggle' )
39
43
p( class ='sidebar__dropdown__text' )
40
44
span( class ='sidebar__dropdown__text__title' ) != (service) ? service .title : ' Mesosphere DC/OS'
0 commit comments