Skip to content

Commit

Permalink
Update search.js
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 30, 2020
1 parent 2cc38ba commit 05568d0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions site/assets/js/search.js
Expand Up @@ -37,12 +37,11 @@
var currentUrl = getOrigin()
var liveUrl = 'https://getbootstrap.com/'

// When in production, return the result as is,
// otherwise remove our url from it.
hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0 ?
// When in production, return the result as is
hit.url :
// replace the URL with a trailing slash, so that
// `hit.url` is relative to server root on development
// When in development, replace `hit.url` with a trailing slash,
// so that the result link is relative to the server root
hit.url.replace(liveUrl, '/')

// Prevent jumping to first header
Expand Down

0 comments on commit 05568d0

Please sign in to comment.