mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Allow globbed mdx files to have typed frontmatter (#4108)
* Allow frontmatter typing for .mdx files from glob `Astro.glob<T>("*.md")` is special cased to allow `T` to be a type for the frontmatter in the markdown. Since .mdx files also get frontmatter added to the globbed result, let's type it as such. * Add changeset Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
This commit is contained in:
parent
a28b441763
commit
08432d5b01
2 changed files with 6 additions and 0 deletions
5
.changeset/dirty-tables-report.md
Normal file
5
.changeset/dirty-tables-report.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Allow globbed mdx files to have typed frontmatter
|
|
@ -241,6 +241,7 @@ export interface AstroGlobalPartial {
|
|||
*/
|
||||
glob(globStr: `${any}.astro`): Promise<AstroInstance[]>;
|
||||
glob<T extends Record<string, any>>(globStr: `${any}.md`): Promise<MarkdownInstance<T>[]>;
|
||||
glob<T extends Record<string, any>>(globStr: `${any}.mdx`): Promise<MarkdownInstance<T>[]>;
|
||||
glob<T extends Record<string, any>>(globStr: string): Promise<T[]>;
|
||||
/**
|
||||
* Returns a [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object built from the [site](https://docs.astro.build/en/reference/configuration-reference/#site) config option
|
||||
|
|
Loading…
Reference in a new issue