astro/.changeset/metal-bugs-drive.md
Ben Holmes bef3a75dbc
Markdoc - remove $entry variable (#7244)
* refactor: remove entry prop from `getRenderModule()`

* refactor: remove `$entry` from markdoc

* test: update entry-prop -> variables test

* refactor: unify `getEntryConfigByExt`

* chore: clean up shared content / data get logic

* docs: update `$entry` recommendation

* chore: rename entry-prop -> variables

* chore: changeset

* chore: missed a spot
2023-05-30 16:18:20 -04:00

417 B

@astrojs/markdoc astro
minor patch

Remove the auto-generated $entry variable for Markdoc entries. To access frontmatter as a variable, you can pass entry.data as a prop where you render your content:

---
import { getEntry } from 'astro:content';

const entry = await getEntry('docs', 'why-markdoc');
const { Content } = await entry.render();
---

<Content frontmatter={entry.data} />