Skip to content

Commit a57d203

Browse files
committed
[v1.9] merge with search PR
1 parent fa35e49 commit a57d203

File tree

10 files changed

+2094
-45
lines changed

10 files changed

+2094
-45
lines changed

_includes/footer.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<!-- Custom Theme JavaScript -->
3131
<script src="{{ "/js/hux-blog.min.js " | prepend: site.baseurl }}"></script>
3232

33+
<!-- script pointing to jekyll-search.js -->
34+
<script src="/js/simple-jekyll-search.min.js"></script>
35+
3336
<!-- Service Worker -->
3437
{% if site.service-worker %}
3538
<script src="{{ "/js/snackbar.js " | prepend: site.baseurl }}"></script>
@@ -78,7 +81,7 @@
7881

7982
$(document).ready(function () {
8083
var $chart = document.querySelector("#chart");
81-
$chart.onload = function(){
84+
$chart.onload = function () {
8285
resizeIframe($chart)
8386
}
8487
window.addEventListener("resize", () => {
@@ -266,4 +269,16 @@
266269
// init
267270
_render();
268271
</script>
269-
{% endif %}
272+
{% endif %}
273+
274+
<!-- Search Settings -->
275+
<script>
276+
SimpleJekyllSearch({
277+
searchInput: document.getElementById('search-input'),
278+
resultsContainer: document.getElementById('results-container'),
279+
json: '/search.json',
280+
searchResultTemplate: '<li><a href="{url}">{title}</a></li>',
281+
noResultsText: 'No results found',
282+
fuzzy: true
283+
});
284+
</script>

_includes/nav.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,32 @@
3030
</li>
3131
{% endif %}
3232
{% endfor %}
33+
<li class="search-icon">
34+
<a href="javascript:void(0)" class="fa fa-search"></a>
35+
</li>
3336
</ul>
3437
</div>
3538
</div>
3639
<!-- /.navbar-collapse -->
3740
</div>
3841
<!-- /.container -->
3942
</nav>
43+
<!-- Search Box -->
44+
<div class="search-box">
45+
<div class="wrapper">
46+
<div class="search-grid">
47+
<form class="search-form">
48+
<div id="search-container">
49+
<input type="text" id="search-input" class="search" placeholder="Search">
50+
</div>
51+
</form>
52+
<ul id="results-container" class="results-search"></ul>
53+
<div class="icon-close-container">
54+
<span class="search-icon-close"><i class="fa fa-times" aria-hidden="true"></i></span>
55+
</div>
56+
</div>
57+
</div>
58+
</div>
4059
<script>
4160
// Drop Bootstarp low-performance Navbar
4261
// Use customize navbar with high-quality material design animation
@@ -88,4 +107,4 @@
88107
if(e.target.className == 'icon-bar') return;
89108
__HuxNav__.close();
90109
})
91-
</script>
110+
</script>

0 commit comments

Comments
 (0)