微调组件,首页和博客页分离

This commit is contained in:
tangly1024
2021-10-14 09:42:00 +08:00
parent 811c2522ba
commit 408c358da7
9 changed files with 145 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
import { getAllPosts, getAllTags } from '@/lib/notion'
import DefaultLayout from '@/layouts/DefaultLayout'
import IndexLayout from '@/layouts/IndexLayout'
export async function getStaticProps () {
let posts = await getAllPosts()
@@ -18,10 +18,10 @@ export async function getStaticProps () {
}
}
const blog = ({ posts, page, tags }) => {
const index = ({ posts, page, tags }) => {
return (
<DefaultLayout tags={tags} posts={posts} page={page} />
<IndexLayout tags={tags} posts={posts} page={page} />
)
}
export default blog
export default index