Merge pull request #962 from abernier/fix-basepath-searchjson

`searchDocumentsPath` taking `BASE_PATH` into account
This commit is contained in:
Timothy 2024-07-13 11:42:52 +08:00 committed by GitHub
commit 1f9c7db465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ function createSearchIndex(allBlogs) {
siteMetadata.search.kbarConfig.searchDocumentsPath
) {
writeFileSync(
`public/${siteMetadata.search.kbarConfig.searchDocumentsPath}`,
`public/${path.basename(siteMetadata.search.kbarConfig.searchDocumentsPath)}`,
JSON.stringify(allCoreContent(sortPosts(allBlogs)))
)
console.log('Local search index generated...')

View File

@ -81,7 +81,7 @@ const siteMetadata = {
search: {
provider: 'kbar', // kbar or algolia
kbarConfig: {
searchDocumentsPath: 'search.json', // path to load documents to search
searchDocumentsPath: `${process.env.BASE_PATH || ''}/search.json`, // path to load documents to search
},
// provider: 'algolia',
// algoliaConfig: {