mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-24 07:26:50 +00:00
hexo主题 新增category、tag分页
This commit is contained in:
@@ -12,8 +12,8 @@ const Index = props => {
|
||||
export async function getStaticProps() {
|
||||
const from = 'index'
|
||||
const props = await getGlobalNotionData({ from })
|
||||
const { allPages, siteInfo } = props
|
||||
const allPosts = allPages.filter(page => page.type === 'Post' && page.status === 'Published')
|
||||
const { siteInfo } = props
|
||||
props.posts = props.allPages.filter(page => page.type === 'Post' && page.status === 'Published')
|
||||
const meta = {
|
||||
title: `${siteInfo?.title} | ${siteInfo?.description}`,
|
||||
description: siteInfo?.description,
|
||||
@@ -21,12 +21,11 @@ export async function getStaticProps() {
|
||||
slug: '',
|
||||
type: 'website'
|
||||
}
|
||||
|
||||
// 处理分页
|
||||
if (BLOG.POST_LIST_STYLE === 'scroll') {
|
||||
props.posts = Array.from(allPosts)
|
||||
// 滚动列表默认给前端返回所有数据
|
||||
} else if (BLOG.POST_LIST_STYLE === 'page') {
|
||||
props.posts = allPosts?.slice(0, BLOG.POSTS_PER_PAGE)
|
||||
props.posts = props.posts?.slice(0, BLOG.POSTS_PER_PAGE)
|
||||
}
|
||||
|
||||
// 预览文章内容
|
||||
|
||||
Reference in New Issue
Block a user