From 0c89b22147753e239540cd0dfd48f54a8530971f Mon Sep 17 00:00:00 2001 From: luobin Date: Wed, 21 Aug 2024 14:17:41 +0800 Subject: [PATCH] =?UTF-8?q?delete:=20=E5=88=A0=E9=99=A4=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- faq/customize-kbar-search.md | 37 +----------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/faq/customize-kbar-search.md b/faq/customize-kbar-search.md index 6e3995e..3cbcfb7 100644 --- a/faq/customize-kbar-search.md +++ b/faq/customize-kbar-search.md @@ -17,41 +17,6 @@ import { Blog } from 'contentlayer/generated' export const SearchProvider = ({ children }) => { const router = useRouter() return ( - router.push('/'), - }, - { - id: 'projects', - name: 'Projects', - keywords: '', - shortcut: ['p'], - section: 'Home', - perform: () => router.push('/projects'), - }, - ], - onSearchDocumentsLoad(json) { - return json.map((post: CoreContent) => ({ - id: post.path, - name: post.title, - keywords: post?.summary || '', - section: 'Blog', - subtitle: post.tags.join(', '), - perform: () => router.push('/' + post.path), - })) - }, - }} - > - {children} - ) } ``` @@ -66,7 +31,7 @@ function createSearchIndex(allBlogs) { ) { writeFileSync( `public/${siteMetadata.search.kbarConfig.searchDocumentsPath}`, - JSON.stringify((sortPosts(allBlogs))) + JSON.stringify(sortPosts(allBlogs)) ) console.log('Local search index generated...') }