Skip to content

Commit

Permalink
Merge branch 'main' into fix-8054
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored Aug 18, 2023
2 parents b00ad12 + be2d602 commit e658e1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twenty-mirrors-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixed an issue where data entries' id included backslashes instead of forward slashes on Windows.
5 changes: 4 additions & 1 deletion packages/astro/src/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ export function getDataEntryId({
collection,
}: Pick<ContentPaths, 'contentDir'> & { 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;
}
Expand Down

0 comments on commit e658e1a

Please sign in to comment.