@@ -24,33 +24,43 @@ module.exports = function(docMap, siteConfig) {
2424 var searchMap = { } ;
2525 var name ;
2626 for ( name in docMap ) {
27- if ( docMap . hasOwnProperty ( name ) ) {
28- var docObj = docMap [ name ] ;
29- var description = docObj . description && docObj . description . trim ( ) ;
30- var signaturesHaveContent = docObj . signatures && docObj . signatures . some ( function ( signature ) {
31- return signature . params || signature . return || signature . options ;
32- } ) ;
33- // If there is no body, it's likely we don't want to index it
34- if ( ( description && description !== 'undefined' ) || signaturesHaveContent ) {
35- var helpers = bitDocsHelpers ( docMap , siteConfig , function ( ) {
36- return docObj ;
37- } , { } ) ;
27+ var docObj = ( docMap . hasOwnProperty ( name ) ) ? docMap [ name ] : null ;
28+ if ( docObj && ! docObj . hide ) {
29+
30+ var helpers = bitDocsHelpers ( docMap , siteConfig , function ( ) {
31+ return docObj ;
32+ } , { } ) ;
3833
39- // Convert bit-docs markdown to HTML
40- var descriptionAsHTML = helpers . makeLinks ( helpers . makeHtml ( description ) ) ;
34+ // Convert bit-docs markdown to HTML
35+ var description = docObj . description && docObj . description . trim ( ) ;
36+ var descriptionAsHTML = helpers . makeLinks ( helpers . makeHtml ( description ) ) ;
4137
42- // Only allow certain HTML elements
43- var descriptionAsStrippedHTML = striptags ( descriptionAsHTML , [ 'a' , 'code' , 'em' , 'strong' ] ) ;
38+ // Only allow certain HTML elements
39+ var descriptionAsStrippedHTML = striptags ( descriptionAsHTML , [ 'a' , 'code' , 'em' , 'strong' ] ) ;
4440
45- var searchObj = {
46- name : docObj . name ,
47- title : docObj . title ,
48- description : descriptionAsStrippedHTML ,
49- url : filename ( docObj , siteConfig ) ,
50- dest : 'doc/'
51- } ;
52- searchMap [ name ] = searchObj ;
41+ var searchObj = {
42+ name : docObj . name ,
43+ title : docObj . title ,
44+ description : descriptionAsStrippedHTML ,
45+ url : filename ( docObj , siteConfig ) ,
46+ dest : 'doc/'
47+ } ;
48+ if ( docObj . collection ) {
49+ searchObj . collection = docObj . collection ;
50+ }
51+ if ( docObj . order ) {
52+ searchObj . order = docObj . order ;
53+ }
54+ if ( docObj . parent ) {
55+ searchObj . parent = docObj . parent ;
56+ }
57+ if ( docObj . subchildren ) {
58+ searchObj . subchildren = docObj . subchildren ;
59+ }
60+ if ( docObj . type ) {
61+ searchObj . type = docObj . type ;
5362 }
63+ searchMap [ name ] = searchObj ;
5464 }
5565 }
5666
0 commit comments