-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[V6]: Various fixes in content collections pages #12685
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
base: stable-live-collections
Are you sure you want to change the base?
[V6]: Various fixes in content collections pages #12685
Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
sarah11918
left a comment
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.
These changes look great, @ArmandPhilippot ! We've been focusing a lot on updating the content collections guide material, but yes, there is still some more generic text in here that needs updating. And, updating the code snippets to all be functional is great!
Left some thoughts re: what we could maybe do in astro-content. See what you think!
Co-authored-by: Sarah Rainsberger <[email protected]>
| An optional Zod object or function that returns a Zod object to configure the type and shape of document frontmatter for a collection. Each value must use [a Zod validator](https://github.com/colinhacks/zod). (For live collections, see the [live `schema`](#schema-1) property.) | ||
|
|
||
| [See the `Content Collection` guide](/en/guides/content-collections/#defining-the-collection-schema) for example usage. | ||
| [See the “Content Collections” guide](/en/guides/content-collections/#defining-the-collection-schema) for example usage. |
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.
Thank you! The backticks in text were bothering me deeply while reviewing this file in the other PR
Description (required)
While reviewing #12604 I figured a PR to that branch would be easier than adding review comments so here's what I suggest to update. This PR mostly fixes code snippets, following HiDeoo's feedback, and rewords a section in the "Content Loader" reference to mention live loaders.
Here's the details:
astro:content:titleon a code snippetSchemaContextcode snippet by adding a loader, and adds highlighting to bring attention on the right partsContent Collectionbecause this is not code?Content Loader reference:
schema, add missing imports)Content Collectionbecause this is not code?Content Collections guide:
title, mostly to code snippets usingAstro.paramsfile()loader snippet to improve theparservisibility and prevent unnecessary overflow on large screens (we don't highlight the curly braces anymore though)lastModified(the first one):itemdoesn't exist so I came up with a pseudo code that seems to do what the comment describesLiveCollectionValidationErrorandLiveEntryNotFoundErrorare not exported fromastro:contentbut fromastro/content/runtime, but looking at the most recent update in the roadmap proposal this should be available fromastro/loaders?Also noting that I did not fix a Typescript error we have in multiple places because of the default preset. For example,
Astro.params.slugcan be undefined so when we use it directly in a function we get:Related issues & labels (optional)
6.0,code snippet update,improve or update documentation