fix: sort post for kbar search
This commit is contained in:
parent
354c628879
commit
2ea12dff88
@ -20,7 +20,7 @@ import rehypeCitation from 'rehype-citation'
|
||||
import rehypePrismPlus from 'rehype-prism-plus'
|
||||
import rehypePresetMinify from 'rehype-preset-minify'
|
||||
import siteMetadata from './data/siteMetadata'
|
||||
import { allCoreContent } from 'pliny/utils/contentlayer.js'
|
||||
import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer.js'
|
||||
|
||||
const root = process.cwd()
|
||||
|
||||
@ -68,7 +68,7 @@ function createSearchIndex(allBlogs) {
|
||||
) {
|
||||
writeFileSync(
|
||||
`public/${siteMetadata.search.kbarConfig.searchDocumentsPath}`,
|
||||
JSON.stringify(allCoreContent(allBlogs))
|
||||
JSON.stringify(allCoreContent(sortPosts(allBlogs)))
|
||||
)
|
||||
console.log('Local search index generated...')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user