diff --git a/.changeset/twenty-mirrors-remember.md b/.changeset/twenty-mirrors-remember.md new file mode 100644 index 000000000..4d758d420 --- /dev/null +++ b/.changeset/twenty-mirrors-remember.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixed an issue where data entries' id included backslashes instead of forward slashes on Windows. diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index d273dc105..23a305426 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -209,7 +209,7 @@ export function getDataEntryId({ collection, }: Pick & { entry: URL; collection: string }): string { const relativePath = getRelativeEntryPath(entry, collection, contentDir); - const withoutFileExt = relativePath.replace(new RegExp(path.extname(relativePath) + '$'), ''); + const withoutFileExt = normalizePath(relativePath).replace(new RegExp(path.extname(relativePath) + '$'), ''); return withoutFileExt; }