-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extend
options to docs and i18n schemas
#1162
Conversation
🦋 Changeset detectedLatest commit: 79400ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We schemust merge this right away!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it with my blog integration which ships a custom schema, works as I expected.
Will happily make the following changes to my docs ^^
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'
import { defineCollection } from 'astro:content'
- import { docsAndBlogSchema } from 'starlight-blog/schema'
+ import { blogSchema } from 'starlight-blog/schema'
export const collections = {
- docs: defineCollection({ schema: docsAndBlogSchema }),
+ docs: defineCollection({ schema: docsSchema({ extend: blogSchema }) }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
}
I would have approved but small question: why are the changes of the i18n guide not visible in the preview? I see the changes in the diff but not in the preview. 🤔
Edit: nvm, they display fine locally, I guess it's a preview issue, weird
Yes, noted this in the PR comment — for some reason Vercel didn’t pick newer commits so the preview is out of date. Don’t really know why! |
Description
extend
option to both the docs and i18n content collection schemas, which allows users to add additional fields to the default schemas.