diff --git a/src/pages/[[...markdownPath]].js b/src/pages/[[...markdownPath]].js index 63fcfcc81..879243c10 100644 --- a/src/pages/[[...markdownPath]].js +++ b/src/pages/[[...markdownPath]].js @@ -151,7 +151,10 @@ export async function getStaticPaths() { files .flat() // ignores `errors/*.md`, they will be handled by `pages/errors/[errorCode].tsx` - .filter((file) => file.endsWith('.md') && !file.startsWith('errors/')) + .filter( + (file) => + file.endsWith('.md') && !file.split('/')[0].startsWith('errors') + ) //Ensure only the top-level folder is checked ); }