Skip to content

Commit 9dcaefb

Browse files
committed
don’t stat files with dots
1 parent f153a4e commit 9dcaefb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/components/links.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export async function readMarkdownSource(f) {
3838
// Recursively find all md files in the directory.
3939
export async function* readMarkdownFiles(root, subpath = "/") {
4040
for (const fname of await readdir(root + subpath)) {
41-
if (fname.startsWith(".") || fname.endsWith(".js")) continue; // ignore .vitepress etc.
42-
if ((await stat(root + subpath + fname)).isDirectory()) yield* readMarkdownFiles(root, subpath + fname + "/");
41+
if (!fname.includes(".") && (await stat(root + subpath + fname)).isDirectory()) yield* readMarkdownFiles(root, subpath + fname + "/");
4342
else if (fname.endsWith(".md")) yield subpath + fname;
4443
}
4544
}

0 commit comments

Comments
 (0)