Upload starter template

This commit is contained in:
Timothy Lin
2021-01-09 17:50:45 +08:00
parent e332766d0f
commit 9a6f4efbb8
72 changed files with 11703 additions and 0 deletions

30
pages/blog.js Normal file
View File

@@ -0,0 +1,30 @@
import { NextSeo } from 'next-seo'
import { getAllFilesFrontMatter } from '@/lib/mdx'
import siteMetadata from '@/data/siteMetadata'
import ListLayout from '@/layouts/ListLayout'
export async function getStaticProps() {
const posts = await getAllFilesFrontMatter('blog')
return { props: { posts } }
}
export default function Blog({ posts }) {
return (
<>
<NextSeo
title={`Blog - ${siteMetadata.name}`}
description={siteMetadata.description}
canonical={`${siteMetadata.siteUrl}/blog`}
openGraph={{
url: `${siteMetadata.siteUrl}/blog`,
title: `Blog - ${siteMetadata.name}`,
description: siteMetadata.description,
}}
/>
<ListLayout posts={posts} title="All Posts"/>
</>
)
}