You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pass both frontmatter and body field for md and mdx content #106
It seems that contentlayer parses out the fields from md and mdx content and only the body of the content is subsequently passed to markdownToHtml or bundleMDX.
This causes an issue with downstream plugins that rely on the frontmatter properties of the document. Could we pass the entire md/mdx file as the body? Thanks.
For example the following mdx document:
---
title: Sample .md file
date: '2016-03-08'
---
A sample post with markdown.
produces the following mdast from contentlayer (logged at the first task of remarkPlugins):
This problem should now be addressed with version 0.1.0. Contentlayer now passes the full raw document string (incl. the frontmatter) to the MD or MDX pipeline.
If you're running into problems, please let me know. :)
Activity
schickling commentedon Feb 11, 2022
This problem should now be addressed with version
0.1.0. Contentlayer now passes the full raw document string (incl. the frontmatter) to the MD or MDX pipeline.If you're running into problems, please let me know. :)