mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 23:16:53 +00:00
Merge branch 'main' into feature/user-auth-clerk
This commit is contained in:
@@ -30,17 +30,17 @@ export async function getStaticPaths() {
|
||||
|
||||
const from = 'slug-paths'
|
||||
const { allPages } = await getGlobalData({ from })
|
||||
|
||||
const paths = allPages
|
||||
?.filter(row => checkSlugHasMorThanTwoSlash(row))
|
||||
.map(row => ({
|
||||
params: {
|
||||
prefix: row.slug.split('/')[0],
|
||||
slug: row.slug.split('/')[1],
|
||||
suffix: row.slug.split('/').slice(2)
|
||||
}
|
||||
}))
|
||||
return {
|
||||
paths: allPages
|
||||
?.filter(row => checkSlugHasMorThanTwoSlash(row))
|
||||
.map(row => ({
|
||||
params: {
|
||||
prefix: row.slug.split('/')[0],
|
||||
slug: row.slug.split('/')[1],
|
||||
suffix: row.slug.split('/').slice(1)
|
||||
}
|
||||
})),
|
||||
paths: paths,
|
||||
fallback: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ export async function getStaticProps({ params: { prefix }, locale }) {
|
||||
fullSlug += '.html'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 在列表内查找文章
|
||||
props.post = props?.allPages?.find(p => {
|
||||
return (
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -55,7 +54,7 @@ function generateLocalesSitemap(link, allPages, locale) {
|
||||
priority: '0.7'
|
||||
},
|
||||
{
|
||||
loc: `${link}${locale}/feed`,
|
||||
loc: `${link}${locale}/rss/feed.xml`,
|
||||
lastmod: new Date().toISOString().split('T')[0],
|
||||
changefreq: 'daily',
|
||||
priority: '0.7'
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user