@@ -65,15 +65,14 @@ function buildNavigation(patternlab) {
65
65
var pattern = patternlab . patterns [ i ] ;
66
66
var bucketName = pattern . name . replace ( / \\ / g, '-' ) . split ( '-' ) [ 1 ] ;
67
67
68
+ // skip underscore-prefixed files. don't create a bucket on account of an underscored pattern
69
+ if ( isPatternExcluded ( pattern ) ) {
70
+ continue ;
71
+ }
72
+
68
73
//check if the bucket already exists
69
74
var bucketIndex = patternlab . bucketIndex . indexOf ( bucketName ) ;
70
75
if ( bucketIndex === - 1 ) {
71
-
72
- // skip underscore-prefixed files. don't create a bucket on account of an underscored pattern
73
- if ( isPatternExcluded ( pattern ) ) {
74
- continue ;
75
- }
76
-
77
76
//add the bucket
78
77
var bucket = new of . oBucket ( bucketName ) ;
79
78
@@ -172,12 +171,6 @@ function buildNavigation(patternlab) {
172
171
173
172
//if it is flat - we should not add the pattern to patternPaths
174
173
if ( flatPatternItem ) {
175
-
176
- // skip underscore-prefixed files
177
- if ( isPatternExcluded ( pattern ) ) {
178
- continue ;
179
- }
180
-
181
174
//add the navItem to patternItems
182
175
bucket . patternItems . push ( navSubItem ) ;
183
176
@@ -187,24 +180,22 @@ function buildNavigation(patternlab) {
187
180
} else {
188
181
189
182
// only do this if pattern is included
190
- if ( ! isPatternExcluded ( pattern ) ) {
191
- //check to see if navItem exists
192
- var navItemIndex = bucket . navItemsIndex . indexOf ( navItemName ) ;
193
- if ( navItemIndex === - 1 ) {
194
- navItem = new of . oNavItem ( navItemName ) ;
195
-
196
- //add the navItem and navSubItem
197
- navItem . navSubItems . push ( navSubItem ) ;
198
- navItem . navSubItemsIndex . push ( navSubItemName ) ;
199
- bucket . navItems . push ( navItem ) ;
200
- bucket . navItemsIndex . push ( navItemName ) ;
201
-
202
- } else {
203
- //add the navSubItem
204
- navItem = bucket . navItems [ navItemIndex ] ;
205
- navItem . navSubItems . push ( navSubItem ) ;
206
- navItem . navSubItemsIndex . push ( navSubItemName ) ;
207
- }
183
+ //check to see if navItem exists
184
+ var navItemIndex = bucket . navItemsIndex . indexOf ( navItemName ) ;
185
+ if ( navItemIndex === - 1 ) {
186
+ navItem = new of . oNavItem ( navItemName ) ;
187
+
188
+ //add the navItem and navSubItem
189
+ navItem . navSubItems . push ( navSubItem ) ;
190
+ navItem . navSubItemsIndex . push ( navSubItemName ) ;
191
+ bucket . navItems . push ( navItem ) ;
192
+ bucket . navItemsIndex . push ( navItemName ) ;
193
+
194
+ } else {
195
+ //add the navSubItem
196
+ navItem = bucket . navItems [ navItemIndex ] ;
197
+ navItem . navSubItems . push ( navSubItem ) ;
198
+ navItem . navSubItemsIndex . push ( navSubItemName ) ;
208
199
}
209
200
210
201
//check if we are moving to a new sub section in the next loop
0 commit comments