diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 2c17fb925d711f52ab5e04ffae0df795abf51841..a2f74e0707adef7e0eff78e27169bf885e0728d3 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -36,16 +36,20 @@ <script src="{{ site.baseurl }}/assets/js/ie-emulation-modes-warning.js"></script> {% if page.layout == "docs" %} -<script src="{{ site.baseurl }}/assets/js/vendor/jekyll-search.min.js"></script> - -<script> -SimpleJekyllSearch.init({ - searchInput: document.getElementById('search-input'), - resultsContainer: document.getElementById('search-results'), - searchResultTemplate: '<a class="dropdown-item" href="{url}">{title}</a>', - noResultsText: '<div class="dropdown-item no-results">Sorry, there are no results for that search.</div>', - json: '{{ site.baseurl }}/search.json' -}) +<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script> +<script type="text/javascript"> + var docsearch = docsearch({ + apiKey: '48cb48b22351bc71ea5f12f4d1ede198', + indexName: 'bootstrap-v4', + inputSelector: '#search-input', + transformData: function (hits) { + return hits.map(function (hit) { + hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', ''); + return hit; + }); + }, + debug: false // Set debug to true if you want to inspect the dropdown + }); </script> {% endif %} diff --git a/docs/_includes/header.html b/docs/_includes/header.html index 57415be54e219759a3529d98774559f1c9c0044f..fd9a9a28c0ee53a24286efa963bf01ef145442af 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -19,6 +19,9 @@ {% endif %} <!-- Documentation extras --> +{% if page.layout == "docs" %} +<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" /> +{% endif %} <link href="{{ site.baseurl }}/assets/css/docs.min.css" rel="stylesheet"> <!-- Favicons --> diff --git a/docs/assets/scss/_sidebar.scss b/docs/assets/scss/_sidebar.scss index 7b9edefea99c5c9ef9e77c13c00eed1eb2b11bc2..d8d3b335bef5faa9a8ef39236c7721310c2ebae3 100644 --- a/docs/assets/scss/_sidebar.scss +++ b/docs/assets/scss/_sidebar.scss @@ -24,33 +24,18 @@ } } -.bd-search-results { - right: 0; - display: block; - padding: 0; - overflow: hidden; - font-size: .9rem; - - &:empty { - display: none; - } - - .dropdown-item { - padding-right: .75rem; - padding-left: .75rem; - - &:first-child { margin-top: .25rem; } - &:last-child { margin-bottom: .25rem; } - } +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #5f2dab; + background: rgba(154, 132, 187, .12); +} - .no-results { - padding: .75rem 1rem; - color: #7a7a7a; - text-align: center; - white-space: normal; // Undo .dropdown-item defaults - } +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(95, 45, 171, .8) !important; } +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(208, 189, 236, .12) !important; +} .bd-sidenav { display: none;