fix: remove search from postbuild

This commit is contained in:
Timothy Lin 2023-07-22 16:02:36 +08:00
parent a23ba55396
commit 67e7801462
2 changed files with 1 additions and 17 deletions

View File

@ -1,8 +1,7 @@
import rss from './rss.mjs'
import search from './search.mjs'
async function postbuild() {
await Promise.all([rss(), search()])
await rss()
}
postbuild()

View File

@ -1,15 +0,0 @@
import { writeFileSync } from 'fs'
import { allCoreContent } from 'pliny/utils/contentlayer.js'
import { allBlogs } from '../.contentlayer/generated/index.mjs'
import siteMetadata from '../data/siteMetadata.js'
const search = () => {
if (siteMetadata?.search?.kbarConfig?.searchDocumentsPath) {
writeFileSync(
`public/${siteMetadata.search.kbarConfig.searchDocumentsPath}`,
JSON.stringify(allCoreContent(allBlogs))
)
console.log('Local search index generated...')
}
}
export default search