jonbio/pages/about.js

22 lines
557 B
JavaScript
Raw Normal View History

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 (
<MDXLayoutRenderer
2021-05-26 20:11:55 +08:00
layout={frontMatter.layout || DEFAULT_LAYOUT}
mdxSource={mdxSource}
frontMatter={frontMatter}
/>
2021-01-09 17:50:45 +08:00
)
}