forked from OpenArchive/open-archive.org-Website-2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.html
39 lines (37 loc) · 1.41 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
---
title: Search Results
layout: page
permalink: /search/
---
<form id="search-refine" action="{{ "/search" | prepend: site.baseurl }}" method="get">
<input type="text" id="search-box" name="query">
<input type="submit" id="search-button" value="search">
</form>
<ul id="search-results"></ul>
<script type="text/javascript">
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 | newline_to_br | jsonify }},
"url": "{{ site.baseurl }}{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
,
{% for page in site.pages %}
"{{ page.url | slugify }}": {
"title": "{{ page.title | xml_escape }}",
"author": "{{ page.author | xml_escape }}",
"category": "{{ page.category | xml_escape }}",
"content": {{ page.content | strip_html | newline_to_br | jsonify }},
"url": "{{ site.baseurl }}{{ page.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
<script type="text/javascript" src="{{ "/js/lunr.js" | prepend: site.baseurl }}"></script>
<script type="text/javascript" src="{{ "/js/search.js" | prepend: site.baseurl }}"></script>