-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.html
27 lines (25 loc) · 949 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
---
layout: default
---
<!-- <form id="search-outer" action="/search.html" method="get">
<input type="text" id="search-box" name="query">
<input type="submit" id= search-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 }}",
"category": "{{ post.category | xml_escape }}",
"content": {{ post.content | strip_html | strip_newlines | jsonify }},
"url": "{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
<!-- 为 lunr.js 添加中文支持。Refer http://linfuyan.com/add-chinese-support-to-lunrjs/ and https://github.com/linfuyan/lunr.js/blob/un-participle/lunr.js -->
<script src="./js/lunr.js"></script>
<script src="./js/search.js"></script>