forked from singh1114/best
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
33 lines (28 loc) · 955 Bytes
/
search.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<html>
<head>
</head>
<body>
<!-- Html Elements for Search -->
<div id="search-container">
<input type="text" id="search-input" placeholder="search...">
<ul id="results-container"></ul>
</div>
<!-- Script pointing to search-script.js -->
<script src="https://unpkg.com/simple-jekyll-search/dest/simple-jekyll-search.min.js" type="text/javascript"></script>
<!-- Configuration -->
<script>
let params = new URLSearchParams(location.search);
if (params.get('s')) {
document.getElementById('search-input').value = params.get('s');
}
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: 'search.json'
})
setTimeout(() => {
window.simpleJekyllSearch.search(params.get('s'))
}, 2000)
</script>
</body>
</html>