| 108 | } |
| 109 | // Recursively go through the content/rest directory and get all the absolute file names |
| 110 | function getCatAndSubCat(directory) { |
| 111 | fs.readdirSync(directory).forEach((file) => { |
| 112 | const absolute = path.join(directory, file) |
| 113 | if (fs.statSync(absolute).isDirectory()) { |
| 114 | return getCatAndSubCat(absolute) |
| 115 | } else if ( |
| 116 | !directory.includes('rest/guides') && |
| 117 | !directory.includes('rest/overview') && |
| 118 | !absolute.includes('rest/index.md') && |
| 119 | !absolute.includes('rest/quickstart.md') && |
| 120 | !file.includes('README.md') |
| 121 | ) { |
| 122 | return contentFiles.push(absolute) |
| 123 | } |
| 124 | }) |
| 125 | } |
| 126 | |
| 127 | // Create a ContentCheck object that has all the categories/subcategories and get the title from frontmatter |
| 128 | async function createContentCheckDirectory() { |