on master help sign in
lib: ignore _index in subdirs
777ef19Matilde Park
lib/lib.js+8−6
@@ -180,12 +180,14 @@ export function getLinksinSubdirs(path) {
180 }
180 }
181 const fileContents = fs.readFileSync(e, "utf8");
181 const fileContents = fs.readFileSync(e, "utf8");
182 const { data } = matter(fileContents, options);
182 const { data } = matter(fileContents, options);
183+ if (!e.includes("_index.md")) {
183− get(fileTree, keys, false).pages.push({
184+ get(fileTree, keys, false).pages.push({
184− title: data.title,
185+ title: data.title,
185− base: parsed.base,
186+ base: parsed.base,
186− slug: parsed.name,
187+ slug: parsed.name,
187− weight: data?.weight ?? 0,
188+ weight: data?.weight ?? 0,
188− });
189+ });
190+ }
189 });
191 });
190 return fileTree;
192 return fileTree;
191}
193}