File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const fs = require('fs');
77
88const COMPONENTS_DOCS_DIR = './docs/components' ;
99const SERVICES_DOCS_DIR = './docs/services' ;
10+ const FOUNDATION_DOCS_DIR = './docs/foundation' ;
1011
1112const VALID_COMPONENTS_CATEGORIES = [
1213 'foundation' ,
@@ -92,14 +93,22 @@ function processComponents(components) {
9293 content += `${ buildOldDocs ( component ) } \n` ;
9394 }
9495
95-
9696 let dirPath ;
97- if ( component . category === 'services' ) {
98- dirPath = `${ SERVICES_DOCS_DIR } ` ;
99- } else {
100- const componentParentDir =
101- componentParentName || isParentComponent ? `/${ componentParentName || componentName } ` : '' ;
102- dirPath = `${ COMPONENTS_DOCS_DIR } /${ component . category } ${ componentParentDir } ` ;
97+ switch ( component . category ) {
98+ case 'services' : {
99+ dirPath = `${ SERVICES_DOCS_DIR } ` ;
100+ break ;
101+ }
102+ case 'foundation' : {
103+ dirPath = `${ FOUNDATION_DOCS_DIR } ` ;
104+ break ;
105+ }
106+ default : {
107+ const componentParentDir =
108+ componentParentName || isParentComponent ? `/${ componentParentName || componentName } ` : '' ;
109+ dirPath = `${ COMPONENTS_DOCS_DIR } /${ component . category } ${ componentParentDir } ` ;
110+ break ;
111+ }
103112 }
104113
105114 if ( ! fs . existsSync ( dirPath ) ) {
You can’t perform that action at this time.
0 commit comments