From aca80a775042bb590e94ed0589545754dcd748fc Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 29 Jul 2023 17:00:52 +0800 Subject: [PATCH] fix --- components/AlgoliaSearchModal.js | 2 +- pages/[prefix]/index.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/AlgoliaSearchModal.js b/components/AlgoliaSearchModal.js index 53cd0fcf..7af1fd6a 100644 --- a/components/AlgoliaSearchModal.js +++ b/components/AlgoliaSearchModal.js @@ -109,7 +109,7 @@ export default function AlgoliaSearchModal({ cRef }) {
搜索
-
+
handleInputChange(e)} diff --git a/pages/[prefix]/index.js b/pages/[prefix]/index.js index 3db22414..e20bf690 100644 --- a/pages/[prefix]/index.js +++ b/pages/[prefix]/index.js @@ -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