mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 15:09:46 +00:00
hexo主题 新增category、tag分页
This commit is contained in:
@@ -37,11 +37,11 @@ export async function getStaticPaths() {
|
||||
export async function getStaticProps({ params: { page } }) {
|
||||
const from = `page-${page}`
|
||||
const props = await getGlobalNotionData({ from })
|
||||
props.page = page
|
||||
const { allPages } = props
|
||||
const allPosts = allPages.filter(page => page.type === 'Post' && page.status === 'Published')
|
||||
// 处理分页
|
||||
props.posts = allPosts.slice(BLOG.POSTS_PER_PAGE * (page - 1), BLOG.POSTS_PER_PAGE * page)
|
||||
props.page = page
|
||||
|
||||
// 处理预览
|
||||
if (BLOG.POST_LIST_PREVIEW === 'true') {
|
||||
|
||||
Reference in New Issue
Block a user