mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-12 00:08:59 +01:00
Remove http
from docs search. (#28557)
We use only `https` for a few months now.
This commit is contained in:
parent
7cc9e794aa
commit
963abd791d
@ -30,12 +30,15 @@
|
|||||||
inputSelector: '#search-input',
|
inputSelector: '#search-input',
|
||||||
transformData: function (hits) {
|
transformData: function (hits) {
|
||||||
return hits.map(function (hit) {
|
return hits.map(function (hit) {
|
||||||
var siteurl = getOrigin()
|
var currentUrl = getOrigin()
|
||||||
var urlRE = /^https?:\/\/getbootstrap\.com/
|
var liveUrl = 'https://getbootstrap.com'
|
||||||
|
|
||||||
// When in production, return the result as is,
|
// When in production, return the result as is,
|
||||||
// otherwise remove our url from it.
|
// 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
|
// Prevent jumping to first header
|
||||||
if (hit.anchor === 'content') {
|
if (hit.anchor === 'content') {
|
||||||
@ -46,6 +49,7 @@
|
|||||||
return hit
|
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
|
||||||
})
|
})
|
||||||
}())
|
}())
|
||||||
|
Loading…
Reference in New Issue
Block a user