christian-hackyourshack / npm

19 stars 3 forks source link

mdast not injected when using astro collections #66

Closed mardybardy closed 1 year ago

mardybardy commented 1 year ago

Pretty self explanatory from the title: when using the new getCollection method provided by Astro to retrieve posts, the mdast tree is not injected into the frontmatter.

Astro Docs: https://docs.astro.build/en/reference/api-reference/#getcollection.

theor commented 1 year ago

I think no feature works with getCollection - autoAbstract/title ain't doing anything either AFAIK.

christian-hackyourshack commented 1 year ago

Have you tried the remarkPluginFrontmatter property of the render result? As the docs for content collections state, remark is only executed when you call render(). m2dx is a remark plugin.

christian-hackyourshack commented 1 year ago

I am deprecating astro-m2dx for astro versions 2 and up in favor of individual packages/remark plugins. Hence, this will not be adressed for Astro 2.0 and later.