Skip to content

Commit 954b0d5

Browse files
author
Janaka-Steph
committed
Fix Lunr search
1 parent 9f0c5e0 commit 954b0d5

File tree

4 files changed

+3
-276
lines changed

4 files changed

+3
-276
lines changed

src/css/search.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
z-index: 100;
2929
display: block;
3030
right: 0;
31-
left: 20px;
31+
left: 20px !important;
3232
top: 100%;
3333
border-radius: 4px;
3434
margin: 6px 0 0;

src/js/vendor/search-lunr.bundle.js

-219
This file was deleted.

src/partials/footer-scripts.hbs

+2-38
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
<script src="https://unpkg.com/tippy.js@5"></script>
1111
{{!-- End Tooltip --}}
1212

13-
<script type="text/javascript" src="{{uiRootPath}}/js/vendor/search-lunr.js"></script>
14-
<script type="text/javascript" src="{{uiRootPath}}/../search-index.js"></script>
1513
<script type="text/javascript" src="{{uiRootPath}}/js/vendor/highlight.js"></script>
1614
<script type="text/javascript" src="{{uiRootPath}}/js/vendor/clipboard.js"></script>
1715
<script type="text/javascript" src="{{uiRootPath}}/js/vendor/tippy.js"></script>
@@ -31,40 +29,6 @@
3129
}
3230
</script>
3331

34-
{{!--
35-
{{#if env.ALGOLIA_API_KEY}}
36-
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
37-
<script>
38-
function focusSearchInput () { document.querySelector('#search-input').focus() }
39-
var search = docsearch({
40-
{{#if env.ALGOLIA_APP_ID}}
41-
appId: '{{env.ALGOLIA_APP_ID}}',
42-
{{/if}}
43-
apiKey: '{{env.ALGOLIA_API_KEY}}',
44-
indexName: '{{env.ALGOLIA_IDX_NAME}}',
45-
inputSelector: '#search-input',
46-
autocompleteOptions: { hint: false, keyboardShortcuts: ['s'] },
47-
algoliaOptions: { hitsPerPage: 10 },
48-
debug: false,
49-
}).autocomplete
50-
search.on('autocomplete:closed', function () { search.autocomplete.setVal() })
51-
focusSearchInput()
52-
window.addEventListener('load', focusSearchInput)
53-
54-
/*
55-
docsearch({
56-
// Your apiKey and indexName will be given to you once
57-
// we create your config
58-
apiKey: '25626fae796133dc1e734c6bcaaeac3c',
59-
indexName: 'docsearch',
60-
//appId: '<APP_ID>', // Should be only included if you are running DocSearch on your own.
61-
// Replace inputSelector with a CSS selector
62-
// matching your search input
63-
inputSelector: '#search-input',
64-
// Set debug to true if you want to inspect the dropdown
65-
debug: false,
66-
})
67-
*/
68-
</script>
32+
{{#if env.SITE_SEARCH_PROVIDER}}
33+
{{> search-scripts}}
6934
{{/if}}
70-
--}}

src/partials/nav-search.hbs

-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
11
<div class="navbar-item">
22
<input id="search-input" type="text" placeholder="Search docs">
33
</div>
4-
5-
{{!--
6-
<div id="search-box" class="search-box is-active">
7-
<span class="algolia-autocomplete" style="position: relative; display: inline-block; direction: ltr;">
8-
<input id="search-input" type="text" placeholder="Search the documentation" class="ds-input" autocomplete="off" spellcheck="false"
9-
role="combobox" aria-autocomplete="list" aria-expanded="false" aria-label="search input"
10-
aria-owns="algolia-autocomplete-listbox-0" dir="auto" style="position: relative; vertical-align: top;"
11-
>
12-
<pre aria-hidden="true"
13-
style="position: absolute; visibility: hidden; white-space: pre; font-family: 'open sans', sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; word-spacing: 0px; letter-spacing: normal; text-indent: 0px; text-rendering: auto; text-transform: none;">
14-
</pre>
15-
<span class="ds-dropdown-menu" role="listbox" id="algolia-autocomplete-listbox-0"
16-
style="position: absolute; top: 100%; z-index: 100; left: 0px; right: auto; display: none;">
17-
<div class="ds-dataset-1"></div>
18-
</span>
19-
</span>
20-
</div>
21-
--}}

0 commit comments

Comments
 (0)