Skip to content

Commit

Permalink
Fix: Content Collections - Ignore .json files nested in non-undersc…
Browse files Browse the repository at this point in the history
…ored 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>
  • Loading branch information
tonydangblog and natemoo-re committed Aug 1, 2023
1 parent 70bbec9 commit e1e958a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/yellow-insects-tell.md
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix: ignore `.json` files nested in subdirectories within content collection directories starting with an `_` underscore.
Expand Up @@ -213,7 +213,7 @@ function globWithUnderscoresIgnored(relContentDir: string, exts: string[]): stri
const contentDir = appendForwardSlash(relContentDir);
return [
`${contentDir}**/*${extGlob}`,
`!${contentDir}**/_*/**${extGlob}`,
`!${contentDir}**/_*/**/*${extGlob}`,
`!${contentDir}**/_*${extGlob}`,
];
}
Empty file.

0 comments on commit e1e958a

Please sign in to comment.