Skip to content

Read const meta / front matter from all mdx files in a directory #1351

Answered by wooorm
michrome asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Mike! This indeed seems to be a question that comes up a lot, so it might be good to answer this once and for ever.

But: it does depend a lot on the tools you are using. So maybe this question is more a question for Gatsby, Next, or another framework.
And it depends on what you actually want to do, so it might not be possible to have one answer.

We’re comparing two things here: frontmatter and import/exports.

Frontmatter is more close to markdown (but not specific to it: many files can have frontmatter. It’s actually more of a preprocessing step, and has more to do with YAML as it supports several “documents” in one file, where the common case is the first one being YAML the rest being…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@realfresh
Comment options

@sebastienbarre
Comment options

@wooorm
Comment options

@omidantilong
Comment options

@wooorm
Comment options

Answer selected by michrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants