aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2019-03-26 12:49:45 +0200
committerXhmikosR <[email protected]>2019-03-27 21:02:22 +0200
commit963abd791da81934d8fbfaab034c5fa7eb7c799e (patch)
tree615c1e777baa59b13f817a44e267963409dd2ca6 /docs
parent7cc9e794aad45bf75cc0af03307ccbed70fb960a (diff)
downloadbootstrap-963abd791da81934d8fbfaab034c5fa7eb7c799e.tar.xz
bootstrap-963abd791da81934d8fbfaab034c5fa7eb7c799e.zip
Remove `http` from docs search. (#28557)
We use only `https` for a few months now.
Diffstat (limited to 'docs')
-rw-r--r--docs/assets/js/src/search.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/assets/js/src/search.js b/docs/assets/js/src/search.js
index 72b1ec71a..1a3a1691f 100644
--- a/docs/assets/js/src/search.js
+++ b/docs/assets/js/src/search.js
@@ -30,12 +30,15 @@
inputSelector: '#search-input',
transformData: function (hits) {
return hits.map(function (hit) {
- var siteurl = getOrigin()
- var urlRE = /^https?:\/\/getbootstrap\.com/
+ var currentUrl = getOrigin()
+ var liveUrl = 'https://getbootstrap.com'
// When in production, return the result as is,
// otherwise remove our url from it.
- hit.url = siteurl.match(urlRE) ? hit.url : hit.url.replace(urlRE, '')
+ // eslint-disable-next-line no-negated-condition
+ hit.url = currentUrl.indexOf(liveUrl) !== -1 ?
+ hit.url :
+ hit.url.replace(liveUrl, '')
// Prevent jumping to first header
if (hit.anchor === 'content') {
@@ -46,6 +49,7 @@
return hit
})
},
- debug: false // Set debug to true if you want to inspect the dropdown
+ // Set debug to `true` if you want to inspect the dropdown
+ debug: false
})
}())