-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cache collections using file name too (#11553)
* fix: cache collections using file name too * oops
- Loading branch information
Showing
10 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes an issue in content collection caching, where two documents with the same contents were generating an error during the build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/content-collections-same-contents/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {defineConfig} from 'astro/config'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
base: '/docs', | ||
vite: { | ||
build: { | ||
assetsInlineLimit: 0 | ||
} | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/astro/test/fixtures/content-collections-same-contents/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@test/content-collections-same-contents", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"astro": "workspace:*" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/astro/test/fixtures/content-collections-same-contents/src/content/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineCollection, z } from 'astro:content'; | ||
|
||
|
||
const docs = defineCollection({ | ||
schema: z.object({ | ||
title: z.string(), | ||
}), | ||
}); | ||
|
||
export const collections = { | ||
docs, | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/astro/test/fixtures/content-collections-same-contents/src/content/docs/one.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: One | ||
--- | ||
|
||
# Title | ||
|
||
stuff | ||
|
7 changes: 7 additions & 0 deletions
7
...s/astro/test/fixtures/content-collections-same-contents/src/content/docs/two.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: One | ||
--- | ||
|
||
# Title | ||
|
||
stuff |
17 changes: 17 additions & 0 deletions
17
packages/astro/test/fixtures/content-collections-same-contents/src/pages/docs.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import { getEntryBySlug } from 'astro:content'; | ||
const entry = await getEntryBySlug('docs', 'one'); | ||
const { Content } = await entry.render(); | ||
--- | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<title>It's content time!</title> | ||
</head> | ||
<body> | ||
<main> | ||
<Content /> | ||
</main> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.