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:
parent
70bbec9c61
commit
e1e958a758
3 changed files with 6 additions and 1 deletions
5
.changeset/yellow-insects-tell.md
Normal file
5
.changeset/yellow-insects-tell.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix: ignore `.json` files nested in subdirectories within content collection directories starting with an `_` underscore.
|
|
@ -213,7 +213,7 @@ function globWithUnderscoresIgnored(relContentDir: string, exts: string[]): stri
|
|||
const contentDir = appendForwardSlash(relContentDir);
|
||||
return [
|
||||
`${contentDir}**/*${extGlob}`,
|
||||
`!${contentDir}**/_*/**${extGlob}`,
|
||||
`!${contentDir}**/_*/**/*${extGlob}`,
|
||||
`!${contentDir}**/_*${extGlob}`,
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue