-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathsearch.html
41 lines (38 loc) · 1.48 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
---
title: Search
sitemap: false
permalink: /search.html
---
<div class="search-page">
<h2>Search Results</h2>
<p><span id="search-process">Loading</span> results <span id="search-query-container" style="display: none;">for "<strong id="search-query"></strong>"</span></p>
<ul id="search-results"></ul>
</div>
<script>
window.data = {
{% for collection in site.collections %}
{% for item in collection.docs %}
{% if item.title %}
{% unless item.excluded_in_search %}
{% if added %},{% endif %}
{% assign added = false %}
"{{ item.id | slugify }}": {
"id": "{{ item.id | slugify }}",
"title": "{{ item.title | xml_escape }}",
"description": "{{item.description | xml_escape }}",
"type": "{{item.type | xml_escape}}",
"url": "{{ site.baseurl }}/#{{ item.collection }}_{{item.title | slugify }}",
"content": {{ item.content_markdown | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }},
{% if item.parameters %}
"parameters" : "{% for parameter in item.parameters %}{{ parameter.name }} {{ parameter.content }}{% if parameter.sub-fields %}{% for field in parameter.sub-fields %}{{ field.name }}{{ field.content }}{% endfor %}{% endif %}{% endfor %}"
{% endif %}
}
{% assign added = true %}
{% endunless %}
{% endif %}
{% endfor %}
{% endfor %}
};
</script>
<script src="{{ site.baseurl }}/js/lunr.min.js"></script>
<script src="{{ site.baseurl }}/js/search.js"></script>