2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

Backport search from v4 and adapt it for v3.4.0.

This commit is contained in:
XhmikosR
2018-09-20 12:07:38 +03:00
parent ebe7459665
commit d24d47c27a
4 changed files with 58 additions and 20 deletions
+4 -18
View File
@@ -29,6 +29,10 @@
<script src="{{ site.baseurl }}/dist/js/bootstrap.js"></script>
{% endif %}
{% if page.layout == "default" %}
<script src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
{% endif %}
{% if site.github %}
<script src="{{ site.baseurl }}/assets/js/docs.min.js"></script>
{% else %}
@@ -37,24 +41,6 @@
{% endfor %}
{% endif %}
{% if page.slug == "getting-started" or page.slug == "css" or page.slug == "components" or page.slug == "js" %}
<script src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script>
var docsearch = docsearch({
apiKey: 'c6aa63796ef2f94c7e7e7f0b93b4a223',
indexName: 'bootstrap-v3',
inputSelector: '#search-input',
transformData: function (hits) {
return hits.map(function (hit) {
hit.url = hit.url.replace('https://getbootstrap.com/', '');
return hit;
});
},
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
{% endif %}
{% if page.slug == "customize" %}
<script>var __configBridge = {{ site.data.configBridge.config | jsonify }}</script>
{% if site.github %}
+1 -1
View File
@@ -28,7 +28,7 @@
{% endif %}
{% endif %}
{% if page.slug == "getting-started" or page.slug == "css" or page.slug == "components" or page.slug == "js" %}
{% if page.layout == "default" %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css">
{% endif %}