mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
标题处理、标签页分页处理
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { getAllPosts, getAllTags } from '@/lib/notion'
|
||||
import IndexLayout from '@/layouts/IndexLayout'
|
||||
import BLOG from '@/blog.config'
|
||||
|
||||
export async function getStaticProps () {
|
||||
let posts = await getAllPosts()
|
||||
@@ -7,20 +8,25 @@ export async function getStaticProps () {
|
||||
post => post.status[0] === 'Published' && post.type[0] === 'Post'
|
||||
)
|
||||
const tags = await getAllTags(posts)
|
||||
|
||||
const meta = {
|
||||
title: `${BLOG.title} | 首页`,
|
||||
description: BLOG.description,
|
||||
type: 'website'
|
||||
}
|
||||
return {
|
||||
props: {
|
||||
page: 1, // current page is 1
|
||||
posts,
|
||||
tags
|
||||
tags,
|
||||
meta
|
||||
},
|
||||
revalidate: 1
|
||||
}
|
||||
}
|
||||
|
||||
const index = ({ posts, page, tags }) => {
|
||||
const index = ({ posts, page, tags, meta }) => {
|
||||
return (
|
||||
<IndexLayout tags={tags} posts={posts} page={page} />
|
||||
<IndexLayout tags={tags} posts={posts} page={page} meta={meta} />
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user