Fix: Content Collections - Ignore .json files nested in non-underscored subdirectories within underscored directories (#7909)

* test: add test file so tests fail before fix

* fix: ignore files nested in underscore directories

* chore: add changeset

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
Tony Dang 2023-08-01 14:08:11 -07:00 committed by GitHub
parent 70bbec9c61
commit e1e958a758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix: ignore `.json` files nested in subdirectories within content collection directories starting with an `_` underscore.

View file

@ -213,7 +213,7 @@ function globWithUnderscoresIgnored(relContentDir: string, exts: string[]): stri
const contentDir = appendForwardSlash(relContentDir);
return [
`${contentDir}**/*${extGlob}`,
`!${contentDir}**/_*/**${extGlob}`,
`!${contentDir}**/_*/**/*${extGlob}`,
`!${contentDir}**/_*${extGlob}`,
];
}