diff --git a/docs-hub/vp-docs.js b/docs-hub/vp-docs.js index bd83b2e..c0b9832 100644 --- a/docs-hub/vp-docs.js +++ b/docs-hub/vp-docs.js @@ -91,6 +91,27 @@ function checkForUnusedFiles(srcFolderPath, subfolders) { const folderPath = path.join(srcFolderPath, folder); const subfolderNames = fs.readdirSync(folderPath); const parentFolder = folderPath.split("/").pop(); + subfolderNames.forEach((subFile) => { + const actualPath = `${parentFolder}/${ + subFile === "index.md" ? "" : subFile + }`; + assert( + configFile.includes(actualPath), + `${actualPath} missing in the nav config` + ); + const fullPath = path.join(srcFolderPath, actualPath); + if (fs.statSync(fullPath).isDirectory()) { + const subFolderFiles = fs.readdirSync(fullPath); + subFolderFiles.forEach((file) => { + if (file !== "index.md") { + assert( + configFile.includes(file.replace(".md", "")), + `${file} missing in the nav config` + ); + } + }); + } + }); }); }