11import { defineDocumentType , FieldDefs , makeSource } from 'contentlayer/source-files' ;
2- import readingTime from 'reading-time' ;
32import rehypeAutolinkHeadings from 'rehype-autolink-headings' ;
43import rehypeExternalLinks from 'rehype-external-links' ;
54import rehypePrism from 'rehype-prism-plus' ;
@@ -9,12 +8,8 @@ import remarkGfm from 'remark-gfm';
98
109const fields : FieldDefs = {
1110 title : { type : 'string' , required : true } ,
12- description : { type : 'string' , required : true } ,
1311 date : { type : 'date' , required : true } ,
14- tags : { type : 'list' , required : true , of : { type : 'string' } } ,
1512 draft : { type : 'boolean' } ,
16- image : { type : 'string' } ,
17- icon : { type : 'string' } ,
1813} ;
1914
2015export const Post = defineDocumentType ( ( ) => ( {
@@ -27,14 +22,6 @@ export const Post = defineDocumentType(() => ({
2722 type : 'string' ,
2823 resolve : ( post ) => `/${ post . _raw . flattenedPath } ` ,
2924 } ,
30- readingMinutes : {
31- type : 'string' ,
32- resolve : ( post ) => Math . ceil ( readingTime ( post . body . raw ) . minutes ) ,
33- } ,
34- wordCount : {
35- type : 'number' ,
36- resolve : ( post ) => post . body . raw . split ( / \s + / gu) . length ,
37- } ,
3825 } ,
3926} ) ) ;
4027
0 commit comments