Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Alter Monorail search route to allow configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinsina committed Jun 9, 2023
1 parent dbe9dff commit 4bf542b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/marko-web-theme-monorail/routes/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ module.exports = (app, siteConfig) => {
const {
contentTypes = ['Article', 'Blog', 'Company', 'Podcast', 'Product', 'Video', 'Whitepaper'],
assignedToWebsiteSectionIds,
defaultSortField,
} = getAsObject(siteConfig, 'search');
const config = new MarkoWebSearchConfig({
resultsPerPage: { default: 18 },
contentTypes,
assignedToWebsiteSectionIds,
defaultSortField,
});
app.get('/search', (req, res, next) => {
if (!get(req, 'query.searchQuery') && get(req, 'query.sortField')) {
Expand Down

0 comments on commit 4bf542b

Please sign in to comment.