lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

Frontmatter injection in remark plugins does not work for MDX files

Open ColinEspinas opened this issue 3 years ago • 1 comments

What version of astro are you using?

1.0.0-rc.8

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows with WSL2 Arch, also tested on Linux Ubuntu

Describe the Bug

When trying to convert my Astro flavored markdown files to MDX I've found that injecting in frontmatter does not work on remark plugins when using the @astro/mdx integration (I was trying to add a reading time computation).

I linked in the reproduction section the repo I've been working on. This might not be a "minimal" reproduction so if needed just ask me and I'll provide one. When checking my repo be sure to stay on the chore/update-astro branch as this is the branch that the changes are about.

Because when using MDX you cannot access the content of the file from the layout like you could with Astro Markdown, you can no longer access it without injecting frontmatter variables.

If you need any details I'll be glad to answer. Have a wonderful day.

Link to Minimal Reproducible Example

https://github.com/ColinEspinas/personal-website/tree/chore/update-astro

Participation

  • [ ] I am willing to submit a pull request for this issue.

ColinEspinas avatar Aug 09 '22 17:08 ColinEspinas

Tagging our resident MDX expert @bholmesdev to take a look!

FredKSchott avatar Aug 10 '22 03:08 FredKSchott