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 template to respect config
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinsina committed Jun 9, 2023
1 parent 4bf542b commit 7b99da6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/marko-web-theme-monorail/templates/search.marko
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ $ const description = i18nIsFunction ? `${i18n("Search")} ${config.siteName()}`

$ const currentPage = search.getCurrentPage();

$ const overrideSortField = get(site, 'config.setSearchSortFieldToScore');
$ const searchQueryPresent = (search.query.searchQuery && search.query.searchQuery !== '');
$ const setDefaultSortField = (searchQueryPresent && !search.query.sortField && overrideSortField);
$ const sortField = setDefaultSortField ? 'SCORE' : search.input.sortField;
$ const sponsorLogo = site.get('search.sponsorLogos.page');

<marko-web-default-page-layout type=type title=title description=description>
Expand Down Expand Up @@ -73,7 +69,7 @@ $ const sponsorLogo = site.get('search.sponsorLogos.page');
</marko-web-search-form>
</div>
<div class="col-xl-3">
<marko-web-search-sort-by sort-field=sortField />
<marko-web-search-sort-by />
<if(sponsorLogo)>
<div class="search-sponsor">
<span class="search-sponsor__label">Sponsored by</span>
Expand All @@ -91,7 +87,7 @@ $ const sponsorLogo = site.get('search.sponsorLogos.page');
<marko-web-search-query|{ nodes, totalCount }|
limit=search.getLimit()
skip=search.getSkip()
sort-field=sortField
sort-field=search.input.sortField
sort-order=search.input.sortOrder
content-types=search.input.contentTypes
search-query=search.input.searchQuery
Expand Down

0 comments on commit 7b99da6

Please sign in to comment.