summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.changeset/bright-keys-sell.md5
-rw-r--r--packages/astro/src/content/utils.ts6
2 files changed, 8 insertions, 3 deletions
diff --git a/.changeset/bright-keys-sell.md b/.changeset/bright-keys-sell.md
new file mode 100644
index 000000000..0222aaf51
--- /dev/null
+++ b/.changeset/bright-keys-sell.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fixes a bug where content config was ignored if it was outside of content dir and has a parent dir with an underscore
diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts
index 1cdafa190..16d703fc7 100644
--- a/packages/astro/src/content/utils.ts
+++ b/packages/astro/src/content/utils.ts
@@ -421,14 +421,14 @@ export function getEntryType(
const { ext } = path.parse(entryPath);
const fileUrl = pathToFileURL(entryPath);
- if (hasUnderscoreBelowContentDirectoryPath(fileUrl, paths.contentDir)) {
+ if (fileUrl.href === paths.config.url.href) {
+ return 'config';
+ } else if (hasUnderscoreBelowContentDirectoryPath(fileUrl, paths.contentDir)) {
return 'ignored';
} else if (contentFileExts.includes(ext)) {
return 'content';
} else if (dataFileExts.includes(ext)) {
return 'data';
- } else if (fileUrl.href === paths.config.url.href) {
- return 'config';
} else {
return 'ignored';
}