主题分页相关调整

This commit is contained in:
tangly1024.com
2024-06-28 16:57:47 +08:00
parent b3e008a5f7
commit 3f686ed16f
32 changed files with 131 additions and 105 deletions

View File

@@ -71,7 +71,7 @@ export async function getStaticPaths() {
// 处理文章页数
const postCount = categoryPosts.length
const totalPages = Math.ceil(
postCount / siteConfig('POSTS_PER_PAGE', 12, NOTION_CONFIG)
postCount / siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG)
)
if (totalPages > 1) {
for (let i = 1; i <= totalPages; i++) {

View File

@@ -23,7 +23,7 @@ export async function getStaticPaths({ locale }) {
const from = 'page-paths'
const { postCount, NOTION_CONFIG } = await getGlobalData({ from, locale })
const totalPages = Math.ceil(
postCount / siteConfig('POSTS_PER_PAGE', 12, NOTION_CONFIG)
postCount / siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG)
)
return {
// remove first page, we 're not gonna handle that.

View File

@@ -27,7 +27,6 @@ export const getServerSideProps = async ctx => {
'Cache-Control',
'public, max-age=3600, stale-while-revalidate=59'
)
console.log('fff', fields)
return getServerSideSitemap(ctx, fields)
}

View File

@@ -56,7 +56,7 @@ export async function getStaticPaths() {
// 处理文章页数
const postCount = tagPosts.length
const totalPages = Math.ceil(
postCount / siteConfig('POSTS_PER_PAGE', 12, NOTION_CONFIG)
postCount / siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG)
)
if (totalPages > 1) {
for (let i = 1; i <= totalPages; i++) {