2021-05-26 19:36:56 +08:00
|
|
|
import { MDXLayoutRenderer } from '@/components/MDXComponents'
|
2021-05-16 15:22:04 +08:00
|
|
|
import { getFileBySlug } from '@/lib/mdx'
|
|
|
|
|
2021-05-26 20:11:55 +08:00
|
|
|
const DEFAULT_LAYOUT = 'AuthorLayout'
|
|
|
|
|
2021-05-16 15:22:04 +08:00
|
|
|
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-26 19:36:56 +08:00
|
|
|
<MDXLayoutRenderer
|
2021-05-26 20:11:55 +08:00
|
|
|
layout={frontMatter.layout || DEFAULT_LAYOUT}
|
2021-05-26 19:36:56 +08:00
|
|
|
mdxSource={mdxSource}
|
|
|
|
frontMatter={frontMatter}
|
|
|
|
/>
|
2021-01-09 17:50:45 +08:00
|
|
|
)
|
|
|
|
}
|