refactor: use mdx rsc
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { MDXLayoutRenderer } from 'pliny/mdx-components'
|
||||
import { MDXComponents } from '@/components/MDXComponents'
|
||||
|
||||
const DEFAULT_LAYOUT = 'AuthorLayout'
|
||||
|
||||
export default function About({ author }) {
|
||||
return (
|
||||
<MDXLayoutRenderer
|
||||
layout={author.layout || DEFAULT_LAYOUT}
|
||||
content={author}
|
||||
MDXComponents={MDXComponents}
|
||||
/>
|
||||
)
|
||||
}
|
@ -1,7 +1,17 @@
|
||||
import { allAuthors } from 'contentlayer/generated'
|
||||
import About from './About'
|
||||
import { Authors, allAuthors } from 'contentlayer/generated'
|
||||
import { Mdx } from '@/components/MDXComponents'
|
||||
import AuthorLayout from '@/layouts/AuthorLayout'
|
||||
import { coreContent } from 'pliny/utils/contentlayer'
|
||||
|
||||
export default function Page() {
|
||||
const author = allAuthors.find((p) => p.slug === 'default')
|
||||
return <About author={author} />
|
||||
const author = allAuthors.find((p) => p.slug === 'default') as Authors
|
||||
const mainContent = coreContent(author)
|
||||
|
||||
return (
|
||||
<>
|
||||
<AuthorLayout content={mainContent}>
|
||||
<Mdx code={author.body.code} />
|
||||
</AuthorLayout>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user