-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9023e6c
commit b8ea1ad
Showing
3 changed files
with
30 additions
and
0 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
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,22 @@ | ||
--- | ||
interface Props { | ||
file: string; | ||
} | ||
const { file } = Astro.props; | ||
// Look up all the Markdown files in the includes folder. | ||
// TODO: handle current locale | ||
const includes = import.meta.glob('../content/includes/**/*.mdx'); | ||
// Find the file that matches the passed `file` prop. | ||
const loader = includes[`../content/includes/${file}`]; | ||
if (!loader) { | ||
throw new Error(`Could not find \`${file}\`.`) | ||
} | ||
const { Content } = await loader() as any; | ||
--- | ||
|
||
<Content /> |
Empty file.