Skip to content

Commit 70d0407

Browse files
fix: search bar should be removed in page find results and should be present in the sidebar
1 parent 0f84821 commit 70d0407

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

assets/js/custom-search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ window.renderGoogleSearchResults = () => {
2222
window.renderPageFindSearchResults = () => {
2323
let urlParams = new URLSearchParams(window.location.search);
2424
let searchTerm = urlParams.get("q") || "";
25-
let sidebarSearch = document.querySelector('.td-sidebar__search');
25+
let sidebarSearch = document.querySelector('#search-results-search');
2626
if (sidebarSearch) {
2727
sidebarSearch.remove();
2828
}

layouts/_default/search.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
Revisit this if / when either of https://github.com/google/docsy/issues/2194 and https://github.com/google/docsy/pull/1512 are closed
44
*/}}
55
{{ define "main" }}
6-
<!--From shortcodes/site-searchbar.html which is used in the home page-->
7-
<div class="col-sm-6 col-md-6 col-lg-6 mx-auto py-3">
6+
7+
{{/*
8+
Do not use the `search-results-search` id elsewhere as it is used
9+
delete this element for pagefind/China users
10+
*/}}
11+
12+
{{/* From shortcodes/site-searchbar.html which is used in the home page */}}
13+
<div id="search-results-search" class="col-sm-6 col-md-6 col-lg-6 mx-auto py-3">
814
{{partial "search-input" .}}
915
</div>
1016
<section class="row td-search-result">

0 commit comments

Comments
 (0)