Skip to content

Commit

Permalink
feat(definitions): update Post definition
Browse files Browse the repository at this point in the history
* Change `filePathPattern` config to "posts/**/*.mdx"
* Add `author` field
  • Loading branch information
mateusfg7 committed May 10, 2023
1 parent 8e0118f commit 567cecf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion content/definitions/Post.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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: {
Expand Down

0 comments on commit 567cecf

Please sign in to comment.