You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v5.2.1
Node v22.12.0
System Windows (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/mdx
@astrojs/react
@astrojs/sitemap
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
In VS code, I started to get a validation error "Property slug is not allowed." in all my markdown post files:
The documentation here still mentions this, so I suppose it should work.
It seems only the fields defined in the collection schema are recognized:
content.config.ts
import{defineCollection,z}from"astro:content";import{glob}from"astro/loaders";constposts=defineCollection({loader: glob({pattern: "**/*.{md,mdx}",base: "./src/content/posts"}),schema: z.object({// Title of the posttitle: z.string(),// Date the post was publishedpublished: z.optional(z.date()),// Date the post was last updatedupdated: z.optional(z.date()),// A short description of the contentdescription: z.string(),// An image to represent the post in previews// This results in image?: string | undefined, see https://github.com/colinhacks/zod/issues/635image: z.optional(z.string()),// A list of tags to categorize the posttags: z.array(z.string()),}),});exportconstcollections={ posts };
This is a code editor problem only, setting the slug works just fine. It just would be nice to not have these errors appear in all markdown files.
What's the expected result?
slug should be recognized as a valid YAML metadata field.
Link to Minimal Reproducible Example
Not possible as the dev environment there accepts arbitrary YAML tags.
Participation
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
In VS code, I started to get a validation error "Property slug is not allowed." in all my markdown post files:
The documentation here still mentions this, so I suppose it should work.
It seems only the fields defined in the collection schema are recognized:
content.config.ts
This is a code editor problem only, setting the slug works just fine. It just would be nice to not have these errors appear in all markdown files.
What's the expected result?
slug
should be recognized as a valid YAML metadata field.Link to Minimal Reproducible Example
Not possible as the dev environment there accepts arbitrary YAML tags.
Participation
The text was updated successfully, but these errors were encountered: