Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pages/[prefix]/[slug]/[...suffix].js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { isExport } from '@/lib/utils/buildMode'
import { checkSlugHasMorThanTwoSlash } from '@/lib/utils/post'
import Slug from '..'

const isStaticExport = process.env.EXPORT === 'true'

/**
* 根据notion的slug访问页面
* 解析三级以上目录 /article/2023/10/29/test
Expand Down Expand Up @@ -50,7 +52,7 @@ export async function getStaticProps({

return {
props,
revalidate: isExport()
revalidate: isStaticExport
? undefined
: siteConfig(
'NEXT_REVALIDATE_SECOND',
Expand Down
4 changes: 3 additions & 1 deletion pages/[prefix]/[slug]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { getStaticPathsBase } from '@/lib/build/staticPaths'
import { isExport } from '@/lib/utils/buildMode'
import { checkSlugHasOneSlash } from '@/lib/utils/post'

const isStaticExport = process.env.EXPORT === 'true'

/**
* 根据notion的slug访问页面
* 解析二级目录 /article/about
Expand Down Expand Up @@ -38,7 +40,7 @@ export async function getStaticProps({ params: { prefix, slug }, locale }) {

return {
props,
revalidate: isExport()
revalidate: isStaticExport
? undefined
: siteConfig(
'NEXT_REVALIDATE_SECOND',
Expand Down
4 changes: 3 additions & 1 deletion pages/[prefix]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { useEffect, useState } from 'react'
import { getStaticPathsBase } from '@/lib/build/staticPaths'
import { isExport } from '@/lib/utils/buildMode'

const isStaticExport = process.env.EXPORT === 'true'

/**
* 根据notion的slug访问页面
* 只解析一级目录例如 /about
Expand Down Expand Up @@ -135,7 +137,7 @@ export async function getStaticProps({ params: { prefix }, locale }) {

return {
props,
revalidate: isExport()
revalidate: isStaticExport
? undefined
: siteConfig(
'NEXT_REVALIDATE_SECOND',
Expand Down
Loading