astro/packages/integrations/mdx/test/fixtures/mdx-frontmatter/src/pages/glob.json.js
Ben Holmes b2b367c969
[MDX] Support YAML frontmatter (#3995)
* chore: remove old comment

* deps: add remark-frontmatter

* deps: add remark-mdx-frontmatter

* fix: handle null or undefined frontmatter key

* feat: configure frontmatter plugins with defaults

* test: frontmatter and custom frontmatter name

* docs: add frontmatterOptions config

* docs: add "variables" and "frontmatter" docs

* chore: excessible -> accessible

* chore: changeset

* chore: remove bad mdx comment
2022-07-20 21:34:21 -04:00

9 lines
220 B
JavaScript

export async function get() {
const mdxPages = await import.meta.glob('./*.mdx', { eager: true });
return {
body: JSON.stringify({
titles: Object.values(mdxPages ?? {}).map(v => v?.frontmatter?.title),
})
}
}