From 567cecf344e426d93ed0f949f92775a8a18ee9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Felipe=20Gon=C3=A7alves?= Date: Wed, 10 May 2023 22:59:02 +0000 Subject: [PATCH] feat(definitions): update Post definition * Change `filePathPattern` config to "posts/**/*.mdx" * Add `author` field --- content/definitions/Post.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/definitions/Post.ts b/content/definitions/Post.ts index ac73dff3..8e88a44c 100644 --- a/content/definitions/Post.ts +++ b/content/definitions/Post.ts @@ -1,9 +1,10 @@ import { defineDocumentType } from 'contentlayer/source-files' +import { authors } from 'lib/authors' export const Post = defineDocumentType(() => ({ name: 'Post', contentType: 'mdx', - filePathPattern: 'posts/*.mdx', + filePathPattern: 'posts/**/*.mdx', fields: { title: { type: 'string', @@ -27,6 +28,11 @@ export const Post = defineDocumentType(() => ({ tags: { type: 'string', required: true + }, + author: { + type: 'enum', + options: authors.map(author => author.user), + required: true } }, computedFields: {