-
-
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.
Ensure base configuration appended to content collection styles (#6182)
* Fix, base appended to propagated scripts * Test scripts
- Loading branch information
Showing
10 changed files
with
108 additions
and
2 deletions.
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 | ||
--- | ||
|
||
Ensure base configuration appended to content collection styles |
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
13 changes: 13 additions & 0 deletions
13
packages/astro/test/fixtures/content-collections-base/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,13 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import mdx from '@astrojs/mdx'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
base: '/docs', | ||
integrations: [mdx()], | ||
vite: { | ||
build: { | ||
assetsInlineLimit: 0 | ||
} | ||
} | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/astro/test/fixtures/content-collections-base/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,9 @@ | ||
{ | ||
"name": "@test/content-collections-base", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"astro": "workspace:*", | ||
"@astrojs/mdx": "workspace:*" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/astro/test/fixtures/content-collections-base/src/components/One.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,7 @@ | ||
<style> | ||
div { color: blue; } | ||
</style> | ||
<script> | ||
console.log('hi'); | ||
</script> | ||
<div>Testing</div> |
12 changes: 12 additions & 0 deletions
12
packages/astro/test/fixtures/content-collections-base/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 { z, defineCollection } from 'astro:content'; | ||
|
||
|
||
const docs = defineCollection({ | ||
schema: z.object({ | ||
title: z.string(), | ||
}), | ||
}); | ||
|
||
export const collections = { | ||
docs, | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/content-collections-base/src/content/docs/one.mdx
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 @@ | ||
--- | ||
title: One | ||
--- | ||
|
||
import One from '../../components/One.astro'; | ||
|
||
# Title | ||
|
||
stuff | ||
|
||
<One /> |
17 changes: 17 additions & 0 deletions
17
packages/astro/test/fixtures/content-collections-base/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.