Skip to content

Commit

Permalink
Move tideSearchApi to be enabled by default (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly committed Jun 23, 2022
1 parent 9298145 commit 4e6689e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 0 additions & 8 deletions examples/reference/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,6 @@ export default {
},
loadOnDemand: 1 // 0 for previous load mode. If you have a custom search page before Ripple v1.5.7, you need small change your code to turn on this. A example: https://github.com/dpc-sdp/ripple/pull/630/files#diff-c797d3457e8f4ca26b5707a65bc76189R37
},
/*
* This is the V2 API - See @dpc-sdp/ripple-tide-search-api for details
*/
searchApi: {
apiBase: 'search-api',
apiVersion: 'v2',
cacheAge: 30
},
cachePurgePattern: []
}
}
8 changes: 6 additions & 2 deletions packages/ripple-nuxt-tide/lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ const nuxtTide = function (moduleOptions) {
this.addServerMiddleware(require('./server-middleware/basic-auth.js'))
}

if (options.searchApi) {
if (options.searchApi || (!options.searchApi && options.modules?.landingPage?.contentCollection !== false)) {
const searchApiOptions = options.searchApi || {}
this.addServerMiddleware(tideSearchApiMiddleware({
templates: options.searchTemplates,
tide: options,
...options.searchApi
apiBase: 'search-api',
apiVersion: 'v2',
cacheAge: 30,
...searchApiOptions
}))
}

Expand Down

0 comments on commit 4e6689e

Please sign in to comment.