Regression in frontmatter accessible to remark plugins in Astro 5 + Content Layer #12778
Closed
1 task
Labels
feat: content layer
Related to the Content Layer feature (scope)
feat: markdown
Related to Markdown (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using Astro v5 with Content Layer, there is a regression in the frontmatter accessible to remark plugins that is no longer the user-defined frontmatter but the frontmatter validated by the collection schema.
Using the following collection definition with a schema only allowing a
title
property and using a transform to add ansomeOtherField
additional field:And the following markdown file:
A remark plugin accessing
file.data.astro?.frontmatter
will get the following object:Using an MDX file with the same content or Astro v4, the object would be:
Additional notes:
npm run dev -- --force
in StackBlitz to see the logsWhat's the expected result?
The expected result should be the same as Astro v4 and be consistent between markdown and MDX files:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-w2juvll6?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: