-
-
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 head injection in body with slots.render() and head buffering (#6216
) * Fix head injection in body with slots.render() and head buffering * Adding a changeset * An MDX test too
- Loading branch information
Showing
11 changed files
with
85 additions
and
9 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 | ||
--- | ||
|
||
Fix head injection in body with slots.render() and head buffering |
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
7 changes: 7 additions & 0 deletions
7
packages/astro/test/fixtures/head-injection/src/components/UsesSlotRender.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 @@ | ||
--- | ||
import SlotRenderComponent from "./SlotRenderComponent.astro"; | ||
--- | ||
|
||
<SlotRenderComponent> | ||
<p slot="slot-name">Paragraph.</p> | ||
</SlotRenderComponent> |
7 changes: 7 additions & 0 deletions
7
packages/astro/test/fixtures/head-injection/src/pages/with-render-slot-in-head-buffer.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 @@ | ||
--- | ||
import Layout from "../components/Layout.astro"; | ||
import UsesSlotRender from "../components/UsesSlotRender.astro" | ||
--- | ||
<Layout> | ||
<UsesSlotRender /> | ||
</Layout> |
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/integrations/mdx/test/fixtures/css-head-mdx/src/components/BaseHead.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,11 @@ | ||
--- | ||
const { title } = Astro.props; | ||
--- | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>{title}</title> | ||
<style is:global> | ||
@import "../styles/global.css"; | ||
</style> |
1 change: 1 addition & 0 deletions
1
packages/integrations/mdx/test/fixtures/css-head-mdx/src/components/GenericComponent.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 @@ | ||
<span>just a generic component</span> |
9 changes: 9 additions & 0 deletions
9
packages/integrations/mdx/test/fixtures/css-head-mdx/src/components/MDXWrapper.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,9 @@ | ||
--- | ||
import Component from "./GenericComponent.astro"; | ||
--- | ||
|
||
<div> | ||
<slot name="title" /> | ||
<slot name="intro" class="inline" /> | ||
<Component /> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
...tegrations/mdx/test/fixtures/css-head-mdx/src/content/posts/using-component.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,13 @@ | ||
--- | ||
title: testing | ||
--- | ||
import MDXWrapper from "../../components/MDXWrapper.astro"; | ||
|
||
<MDXWrapper> | ||
<h1 slot="title"> | ||
testing | ||
</h1> | ||
<div slot="intro"> | ||
Intro | ||
</div> | ||
</MDXWrapper> |
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