From d4eff9626f549f0d1cc6e96d7faf5beea8707c29 Mon Sep 17 00:00:00 2001 From: Mason Houtz Date: Mon, 22 Feb 2021 09:04:19 -0800 Subject: [PATCH] removed duplicate subsection generation --- client/docs/sections.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/docs/sections.js b/client/docs/sections.js index 30437cfb3a3..7bffe4b6cd9 100644 --- a/client/docs/sections.js +++ b/client/docs/sections.js @@ -25,7 +25,7 @@ function getDocSections(rootPath, options = {}) { sections.set(rootPath, rootNode); childToParent.set(rootPath, null); - // const singleGlob = path.join(rootPath, "**/*.(md|js|vue)"); + // get all matching doc files const selector = path.join(rootPath, "**", docSelector); const allFiles = glob.sync(selector, { ignore }); @@ -50,9 +50,9 @@ function getDocSections(rootPath, options = {}) { midFolders.pop(); } - // add file to section now that it exists + // if it's a MD file, add to parent as a subsection const section = sections.get(p.dir); - if (section && file !== section.content) { + if (section && file !== section.content && p.ext == ".md") { section.children.add({ name: titleize(humanize(p.name)), content: file,