Skip to content

mdx partial file frontmatter warning #9638

Answered by slorber
patdavid asked this question in Q&A
Discussion options

You must be logged in to vote

We don't have an ability to disable that warning currently.

It is here for a reason and prevent you from adding useless front-matter that Docusaurus won't consider. But I see how it could be annoying in some special cases.

In v3.1 (or canary) we will ship a parseFrontMatter generic feature that should solve the problem: #9624

export default {
  markdown: {
    parseFrontMatter: async (params) => {
      const result = await params.defaultParseFrontMatter(params);

      if (isPartial(params.filePath)) {
        result.frontMatter = {};
      }

      return result;
    },
  },
}

The idea is that you can "erase" the front matter before docusaurus can even see it.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by patdavid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants