-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.html
69 lines (61 loc) · 2.22 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
layout: page
title: Search
permalink: /search/
---
<div style="margin-bottom:10px;">
<form action="/search" method="get" class="search">
<input type="text" id="search-box" name="query" placeholder="Search...">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
<span id="resultsFound"></span>
<div class="content_separator" style="margin-top: 18px;"></div>
<ul id="search-results" class="post-list"></ul>
<script>
window.store = {
{% for post in site.posts %}
"{{ post.url }}": {
"title": "{{ post.title | xml_escape }}",
"content" : "{{post.content | strip_html | strip_newlines | remove: " " | escape | remove: "\"}}",
"url": " {{ post.url | xml_escape }}",
"authors": "{% for author in post.by %}{{ author }}{% unless forloop.last %}, {% endunless %}{% endfor %}",
"tags": "{% for tag in post.tags %}{{ tag }}{% unless forloop.last %}, {% endunless %}{% endfor %}",
"image": "{{ post.image }}",
"project_url": "{{ post.project_url }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
papers_index = {
{% for paper in site.papers %}
"{{ paper.external_url }}": {
"title": "{{ paper.title | xml_escape }}",
"content" : "{{ paper.authors }} ({{ paper.year }}) - {{ paper.publication }}",
"url": " {{ paper.external_url | xml_escape }}",
"authors": "{{ paper.authors }}",
"tags": "",
"image": "/paper.png",
"project_url": ""
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
datasets_index = {
{% for dataset in site.datasets %}
"{{ dataset.external_url }}": {
"title": "{{ dataset.title | xml_escape }}",
"content" : "{{dataset.content | strip_html | strip_newlines | remove: " " | escape | remove: "\"}}",
"url": " {{ dataset.project_url | xml_escape }}",
"authors": "{{ dataset.authors }}",
"tags": "",
"image": "/dataset.png",
"project_url": ""
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
Object.assign(window.store, papers_index, datasets_index);
</script>
<script src="/js/lunr.js"></script>
<script src="/js/search.js"></script>