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

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,7 +1,7 @@
import { getAllPosts, getAllTags } from '@/lib/notion'
import BLOG from '@/blog.config'
import DefaultLayout from '@/layouts/DefaultLayout'
import { useRouter } from 'next/router'
import PageLayout from '@/layouts/PageLayout'
const Page = ({ posts, tags, page }) => {
let filteredBlogPosts = posts
@@ -16,7 +16,7 @@ const Page = ({ posts, tags, page }) => {
}
}
return <DefaultLayout tags={tags} posts={filteredBlogPosts} page={page} />
return <PageLayout tags={tags} posts={filteredBlogPosts} page={page} />
}
export async function getStaticProps (context) {