This commit is contained in:
tangly1024
2023-07-29 17:00:52 +08:00
parent c5ba9a8033
commit aca80a7750
2 changed files with 4 additions and 6 deletions

View File

@@ -95,10 +95,8 @@ export async function getStaticPaths() {
}
}
export async function getStaticProps(p) {
const { params } = p
console.log('getStaticProps', p)
let fullSlug = params.prefix
export async function getStaticProps({ params: { prefix } }) {
let fullSlug = prefix
if (JSON.parse(BLOG.PSEUDO_STATIC)) {
if (!fullSlug.endsWith('.html')) {
fullSlug += '.html'
@@ -113,7 +111,7 @@ export async function getStaticProps(p) {
// 处理非列表内文章的内信息
if (!props?.post) {
const pageId = params.PSEUDO_STATICprefix.slice(-1)[0]
const pageId = prefix.slice(-1)[0]
if (pageId.length >= 32) {
const post = await getNotion(pageId)
props.post = post