mirror of
https://github.com/danog/sass-site.git
synced 2025-01-21 21:31:34 +01:00
Make search result URLs always point to the current site
This commit is contained in:
parent
b75fca5a61
commit
05d3c9121d
@ -157,6 +157,15 @@
|
||||
apiKey: 'a409ff5d6a2476083c1a8dd1f8c04ec5',
|
||||
indexName: 'sass-lang',
|
||||
inputSelector: 'input.search',
|
||||
transformData: function(hits) {
|
||||
var domain = window.location.origin + "/";
|
||||
hits.forEach(function(hit) {
|
||||
if (!hit.url.startsWith(domain)) {
|
||||
hit.url = hit.url.replace(/^https?:\/\/[^\/]+\//, domain);
|
||||
}
|
||||
});
|
||||
return hits;
|
||||
},
|
||||
debug: false
|
||||
});
|
||||
= javascript_include_tag 'vendor/modernizr.custom.min'
|
||||
|
Loading…
x
Reference in New Issue
Block a user