-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: frontmatter injection in layout
- Loading branch information
1 parent
6ae2e4f
commit 8f0d1e9
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/integrations/mdx/test/fixtures/mdx-frontmatter-injection/src/layouts/Base.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 @@ | ||
--- | ||
const defaults = { title: 'Frontmatter not passed to layout!' } | ||
const { frontmatter = defaults, content = defaults } = Astro.props; | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{frontmatter.title ?? content.title}</title> | ||
</head> | ||
<body> | ||
<slot /> | ||
</body> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
...s/integrations/mdx/test/fixtures/mdx-frontmatter-injection/src/pages/page-1.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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
layout: '../layouts/Base.astro' | ||
--- | ||
|
||
# Page 1 | ||
|
||
Look at that! |
4 changes: 4 additions & 0 deletions
4
...s/integrations/mdx/test/fixtures/mdx-frontmatter-injection/src/pages/page-2.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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
layout: '../layouts/Base.astro' | ||
--- | ||
|
||
# Page 2 | ||
|
||
## Table of contents | ||
|
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