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
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. :)
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
orbundleMDX
.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:
produces the following mdast from contentlayer (logged at the first task of
remarkPlugins
):Using
mdx-bundler
directly gives the following output:The text was updated successfully, but these errors were encountered: