0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: allow content config in underscored dir (#12522)

This commit is contained in:
Matt Kane 2024-11-25 13:59:31 +00:00 committed by GitHub
parent 14feaf30e1
commit 33b0e305fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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';
}