Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontmatter injection in remark plugins does not work for MDX files #4216

Closed
1 task
ColinEspinas opened this issue Aug 9, 2022 · 1 comment · Fixed by #4255
Closed
1 task

Frontmatter injection in remark plugins does not work for MDX files #4216

ColinEspinas opened this issue Aug 9, 2022 · 1 comment · Fixed by #4255
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@ColinEspinas
Copy link

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.
@FredKSchott FredKSchott added the - P3: minor bug An edge case that only affects very specific usage (priority) label Aug 10, 2022
@FredKSchott
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants