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