refactor: migrate to rsc and app dir
This commit is contained in:
16
app/about/About.tsx
Normal file
16
app/about/About.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
'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}
|
||||
/>
|
||||
)
|
||||
}
|
7
app/about/page.tsx
Normal file
7
app/about/page.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import { allAuthors } from 'contentlayer/generated'
|
||||
import About from './About'
|
||||
|
||||
export default function Page() {
|
||||
const author = allAuthors.find((p) => p.slug === 'default')
|
||||
return <About author={author} />
|
||||
}
|
Reference in New Issue
Block a user