-
Notifications
You must be signed in to change notification settings - Fork 14
/
search.html
49 lines (45 loc) · 1.32 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
39
40
41
42
43
44
45
46
47
48
49
---
layout: default
permalink: /search/
order: 5
---
<style>
ul#search-results {
margin-top: 30px;
margin-left: 0;
}
ul#search-results li {
margin-bottom: 30px;
list-style-type: none;
}
ul#search-results h3 {
margin-bottom: 0px;
}
input#search-box {
width: 400px;
}
</style>
<h1>Search</h1>
<form action="{{ page.url }}" method="get">
<input type="text" id="search-box" name="query" placeholder="Title, author, content, tags">
<input type="submit" value="search">
</form>
<ul id="search-results"></ul>
<script>
window.store = {
{% for post in site.posts %}
"{{ post.url | slugify }}": {
"title": "{{ post.title | xml_escape }}",
"author": "{{ post.author | xml_escape }}", // Author of the review
"cite_authors": "{{ post.cite.authors | xml_escape }}", // Authors of the paper
"cite_venue": "{{ post.cite.venue | xml_escape }}",
"content": {{ post.content | strip_html | strip_newlines | jsonify }}, // important for showing a content excerpt in search results
"tags": "{{ post.tags | join: ' ' }}",
"url": "{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
<script src="{{ site.url }}/js/lunr.min.js"></script>
<script src="{{ site.url }}/js/search.js"></script>