2021-05-16 15:22:04 +08:00
|
|
|
import { MDXRemote } from 'next-mdx-remote'
|
|
|
|
import MDXComponents from '@/components/MDXComponents'
|
2021-05-16 15:36:01 +08:00
|
|
|
import AuthorLayout from '@/layouts/AuthorLayout'
|
2021-05-16 15:22:04 +08:00
|
|
|
import { getFileBySlug } from '@/lib/mdx'
|
|
|
|
|
|
|
|
export async function getStaticProps() {
|
|
|
|
const authorDetails = await getFileBySlug('authors', ['default'])
|
|
|
|
return { props: { authorDetails } }
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function About({ authorDetails }) {
|
|
|
|
const { mdxSource, frontMatter } = authorDetails
|
2021-01-09 17:50:45 +08:00
|
|
|
|
|
|
|
return (
|
2021-05-16 15:36:01 +08:00
|
|
|
<AuthorLayout frontMatter={frontMatter}>
|
|
|
|
<MDXRemote {...mdxSource} components={MDXComponents} />
|
|
|
|
</AuthorLayout>
|
2021-01-09 17:50:45 +08:00
|
|
|
)
|
|
|
|
}
|