Skip to content

Commit 0cf3b1f

Browse files
authored
Add support for foundation category in documentation build process (#3599)
1 parent 196d286 commit 0cf3b1f

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

scripts/docs/buildDocsCommon.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const fs = require('fs');
77

88
const COMPONENTS_DOCS_DIR = './docs/components';
99
const SERVICES_DOCS_DIR = './docs/services';
10+
const FOUNDATION_DOCS_DIR = './docs/foundation';
1011

1112
const 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)) {

0 commit comments

Comments
 (0)