2021-01-09 17:50:45 +08:00
|
|
|
import { getAllFilesFrontMatter } from '@/lib/mdx'
|
|
|
|
import siteMetadata from '@/data/siteMetadata'
|
|
|
|
import ListLayout from '@/layouts/ListLayout'
|
2021-01-10 17:35:37 +08:00
|
|
|
import { PageSeo } from '@/components/SEO'
|
2021-01-09 17:50:45 +08:00
|
|
|
|
|
|
|
export async function getStaticProps() {
|
|
|
|
const posts = await getAllFilesFrontMatter('blog')
|
|
|
|
|
|
|
|
return { props: { posts } }
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Blog({ posts }) {
|
|
|
|
return (
|
|
|
|
<>
|
2021-01-10 17:35:37 +08:00
|
|
|
<PageSeo
|
2021-01-10 14:32:35 +08:00
|
|
|
title={`Blog - ${siteMetadata.author}`}
|
2021-01-09 17:50:45 +08:00
|
|
|
description={siteMetadata.description}
|
2021-01-10 17:35:37 +08:00
|
|
|
url={`${siteMetadata.siteUrl}/blog`}
|
2021-01-09 17:50:45 +08:00
|
|
|
/>
|
2021-01-10 14:32:35 +08:00
|
|
|
<ListLayout posts={posts} title="All Posts" />
|
2021-01-09 17:50:45 +08:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|