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

@@ -109,7 +109,7 @@ export default function AlgoliaSearchModal({ cRef }) {
<div className='flex justify-between items-center'>
<div className='text-2xl text-blue-600 font-bold'>搜索</div>
<div><i class="text-gray-600 fa-solid fa-xmark p-1 cursor-pointer hover:text-blue-600" onClick={closeModal} ></i></div>
<div><i className="text-gray-600 fa-solid fa-xmark p-1 cursor-pointer hover:text-blue-600" onClick={closeModal} ></i></div>
</div>
<input type="text" placeholder="在这里输入搜索关键词..." onChange={(e) => handleInputChange(e)}

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