refactor: migrate to rsc and app dir

This commit is contained in:
Timothy Lin
2023-07-07 11:17:22 +08:00
parent a03d358ef9
commit 09ba0550ca
121 changed files with 13431 additions and 12945 deletions

16
app/about/About.tsx Normal file
View 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
View 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} />
}