diff --git a/pages/[...slug].js b/pages/[...slug].js
index d6900b73..1523c674 100644
--- a/pages/[...slug].js
+++ b/pages/[...slug].js
@@ -28,7 +28,6 @@ const Slug = props => {
*/
const validPassword = passInput => {
const encrypt = md5(post.slug + passInput)
- console.log('passInput', passInput, post.slug)
if (passInput && encrypt === post.password) {
setLock(false)
return true
diff --git a/themes/gitbook/components/NavPostList.js b/themes/gitbook/components/NavPostList.js
index bf5462a1..0cb8c3bf 100644
--- a/themes/gitbook/components/NavPostList.js
+++ b/themes/gitbook/components/NavPostList.js
@@ -1,6 +1,7 @@
import NavPostListEmpty from './NavPostListEmpty'
import { useRouter } from 'next/router'
import NavPostItem from './NavPostItem'
+import { useGitBookGlobal } from '..'
/**
* 博客列表滚动分页
@@ -10,8 +11,8 @@ import NavPostItem from './NavPostItem'
* @constructor
*/
const NavPostList = (props) => {
- const { posts = [], currentSearch } = props
- const filteredPosts = Object.assign(posts)
+ const { filteredPosts } = useGitBookGlobal()
+
const router = useRouter()
let selectedSth = false
@@ -34,7 +35,7 @@ const NavPostList = (props) => {
}
if (!filteredPosts || filteredPosts.length === 0) {
- return
` - containerInner?.insertAdjacentHTML('afterbegin', newHTML) + useEffect(() => { + router.push(CONFIG.INDEX_PAGE).then(() => { + // console.log('跳转到指定首页', CONFIG.INDEX_PAGE) + setTimeout(() => { + if (isBrowser()) { + const article = document.getElementById('notion-article') + if (!article) { + console.log('请检查您的Notion数据库中是否包含此slug页面: ', CONFIG.INDEX_PAGE) + const containerInner = document.getElementById('container-inner') + const newHTML = `请在您的notion中添加一个slug为${CONFIG.INDEX_PAGE}的文章
` + containerInner?.insertAdjacentHTML('afterbegin', newHTML) + } } - } - }, 7 * 1000) - }) + }, 7 * 1000) + }) + }, []) return请在您的notion中添加一个slug为${CONFIG.INDEX_PAGE}的文章