Skip to content

Commit

Permalink
Merge pull request #962 from abernier/fix-basepath-searchjson
Browse files Browse the repository at this point in the history
`searchDocumentsPath` taking `BASE_PATH` into account
  • Loading branch information
timlrx committed Jul 13, 2024
2 parents dceb283 + 6acab36 commit 1f9c7db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...')
Expand Down
2 changes: 1 addition & 1 deletion data/siteMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 1f9c7db

Please sign in to comment.