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:
parent
14feaf30e1
commit
33b0e305fe
2 changed files with 8 additions and 3 deletions
5
.changeset/bright-keys-sell.md
Normal file
5
.changeset/bright-keys-sell.md
Normal 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
|
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue