-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.html
39 lines (37 loc) · 1.26 KB
/
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
34
35
36
37
38
---
title: search
layout: default
permalink: /search/
---
<script src="/js/search.min.js" type="text/javascript" charset="utf-8"></script>
<div id="search">
<form action="/search" method="get">
<input type="text" id="search-query" name="q" placeholder="Search" autocomplete="off">
</form>
</div>
<section id="search-results" style="display: none;">
<p>Search results</p>
<div class="entries">
</div>
</section>
{% raw %}
<script id="search-results-template" type="text/mustache">
{{#entries}}
<div class="search-entry">
<a href="{{url}}">{{title}}</a> {{#date}}<time datetime="{{pubdate}}"
pubdate>{{displaydate}}</time>{{/date}}<br>
<p>{{body}}</p>
</div>
{{/entries}}
</script>
{% endraw %}
<script type="text/javascript">
$(function() {
$('#search-query').lunrSearch({
indexUrl: '/search.json', // URL of the `search.json` index data for your site
results: '#search-results', // jQuery selector for the search results container
entries: '.entries', // jQuery selector for the element to contain the results list, must be a child of the results element above.
template: '#search-results-template' // jQuery selector for the Mustache.js template
});
});
</script>