I am trying to use the remarkjs ecosystem to parse a file containing markdown and frontmatter, and turn it into HTML. The file could look something like this:
---
title: Title
---
# This is a heading
I managed to parse the markdown, which can be done by following the example in the GitHub README file, and I also know that there is a remark-frontmatter
package. However, just using the package like in the before-mentioned example makes it so the parser ignores the frontmatter part entirely. Of course that part shouldn't be included in the HTML, but I still want to use it. But as far as I can tell, it is not part of the output. That brings me to my question: How can I access the frontmatter using these packages? I know that it is being parsed somewhere in the process, but how can I access this?
remarkParseFrontmatter
is deprecated. Ended usinggray-matter
– Lowland