Custom frontmatter/metadata defined in markdown files is no longer accessible within the DocItem component when it previously was.
It appears this change broke the behavior.
Yes
Frontmatter, by nature, should allow for a variety of keys, especially a platform designed to serve a variety of different project types.
Its not a bug. Its actually a bug that got fixed.
Its never been documented anyway that you can access frontmatter through metadata. Even in v1 it will throw error if you add unsupported field.
You should not access frontmatter from metadata. Metadata is something done by plugin.
Example: /docs/guides/hello.md defined with frontmatter id: “hello” will have a metadata.id of “guides/hello”
If you want to access frontmatter, do it through content.frontmatter
reasoning is here
https://github.com/facebook/docusaurus/pull/1450
Clean up blog data props structure by splitting metadata and front matter into two separate props. This is helpful in letting users add whatever they want to the front matter and have it being referenced in blog posts. Metadata is something that is controlled by the plugin. There will not be collisions if we split it up. For blog list pages, I've also cleaned them up a bit and reused the blog item metadata and front matter. It was being duplicated in the list's metadata and the entries 😓
Its also clear in the link you showed that https://github.com/facebook/docusaurus/blob/8a948102c3e31abcdfd6ee32a8e1d8e4b057c4c4/packages/docusaurus-theme-classic/src/theme/DocItem/index.js#L68 frontmatter is accessible.
Thanks, I must have been using an older version of DocItem/index.js because the frontMatter definition was not included.
@binarylogic We would discourage swizzling components at this point until we reach beta or even 2.0.0 for this very reason. Apologies for the changes.