File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
docs/content/docs/3.files Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -522,6 +522,23 @@ Description property will contain the excerpt content unless defined within the
522
522
523
523
If there is no ` <!--more--> ` divider in the text then excerpt is undefined.
524
524
525
+ :: tip
526
+ You should define the ` excerpt ` field in the collection schema if you want to use the excerpt feature.
527
+ ``` ts [content.config.ts]
528
+ const content = defineCollection ({
529
+ type: ' page' ,
530
+ source: ' **' ,
531
+ schema: z .object ({
532
+ excerpt: z .object ({
533
+ type: z .string (),
534
+ children: z .any (),
535
+ }),
536
+ }),
537
+ })
538
+ ```
539
+ Read more about the [ collection schema] ( /docs/collections/define#collection-schema ) .
540
+ ::
541
+
525
542
Example variables will be injected into the document:
526
543
527
544
``` json
You can’t perform that action at this time.
0 commit comments