feat: complete MDX migration for blog, fix diagram fidelity and refactor styling architecture
This commit is contained in:
28
apps/web/contentlayer.config.ts
Normal file
28
apps/web/contentlayer.config.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { defineDocumentType, makeSource } from 'contentlayer2/source-files'
|
||||
|
||||
export const Post = defineDocumentType(() => ({
|
||||
name: 'Post',
|
||||
filePathPattern: `blog/**/*.mdx`,
|
||||
contentType: 'mdx',
|
||||
fields: {
|
||||
title: { type: 'string', required: true },
|
||||
date: { type: 'string', required: true },
|
||||
description: { type: 'string', required: true },
|
||||
tags: { type: 'list', of: { type: 'string' }, required: true },
|
||||
},
|
||||
computedFields: {
|
||||
slug: {
|
||||
type: 'string',
|
||||
resolve: (doc) => doc._raw.sourceFileName.replace(/\.mdx$/, ''),
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
resolve: (post) => `/blog/${post._raw.sourceFileName.replace(/\.mdx$/, '')}`,
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
export default makeSource({
|
||||
contentDirPath: 'content',
|
||||
documentTypes: [Post],
|
||||
})
|
||||
Reference in New Issue
Block a user