Skip to content

Commit

Permalink
Fix bug where search does not work for URL path /search/
Browse files Browse the repository at this point in the history
If a tech docs site is being served by nginx the path /search will be
redirected to /search/. This commit updates the test of whether the
browser is on the search page to handle this.
  • Loading branch information
lfdebrux committed Sep 23, 2021
1 parent baf0ba2 commit 1355757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assets/javascripts/_modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
changeSearchLabel()

// Only do searches on the search page
if (window.location.pathname === '/search') {
if (window.location.pathname.match(/\/search(\/|\/index.html)?$/)) {
$html.addClass('has-search-results-open')

if (window.location.search) {
Expand Down

0 comments on commit 1355757

Please sign in to comment.