forked from sanderslab/sanderslab.github.io
-
Notifications
You must be signed in to change notification settings - Fork 7
/
search.html
32 lines (30 loc) · 1.03 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
---
layout: search
---
<form action="/search.html" method="get">
<label for="search-box">Search</label>
<input type="text" id="search-box" name="query">
<input type="submit" value="search">
</form>
<ul id="search-results"></ul>
<script>
window.store = {
{% assign searchable_pages = site.pages %}
{% assign searchable_documents = site.documents %}
{% for page in searchable_pages %}
{% assign searchable_documents = searchable_documents | push: page %}
{% endfor %}
{% for post in searchable_documents %}
"{{ post.url | slugify }}": {
"title": "{{ post.title | xml_escape }}",
"author": "{{ post.author | xml_escape }}",
"category": "{{ post.category | xml_escape }}",
"content": {{ post.content | markdownify | strip_html | strip_newlines | jsonify }},
"url": "{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
<script src="/js/lunr.min.js"></script>
<script src="/js/search.js"></script>