forked from SAFEHR-data/uclh-research-discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
54 lines (53 loc) · 1.75 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
---
layout: default
---
<div class="container">
<div class="row row-cols-1 row-cols-md-3 g-4" id="search-results"></div>
</div>
<script>
window.store = {
{%- for project in site.projects -%}
"{{ project.url | slugify }}": {
"title": "{{ project.title | xml_escape }}",
"authors": "{{ project.authors | join: ", " | xml_escape }}",
"status": "{{ project.status }}",
"category": "{{ project.category | xml_escape }}",
"content": {{ project.content | strip_html | strip_newlines | jsonify }},
"url": "{{ project.url | xml_escape | relative_url }}"
}
{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
};
</script>
{% raw %}
<script id="resultTemplate" type=""text/x-handlebars-template">
<div class="col">
<div class="card mb-3 project-card" style="height: 18rem;">
<div class="card-header">
<div class="row justify-content-between">
<div class="col-9">
<h5>{{title}}</h5>
</div>
<div class="col-3">
<p><span class="badge rounded-pill {{status}}">{{status}}</span></p>
</div>
</div>
<small class="text-muted authors">
{{#if authors}}
{{ truncate authors 40}}<span class="tooltiptext">{{authors}}</span>
{{/if}}
</small>
</div>
<div class="card-body">
<p class="card-text">{{summary}}</p>
</div>
<div class="card-footer">
<a href="{{url}}" class="btn btn-outline-primary">Details</a>
</div>
</div>
</div>
</script>
{% endraw %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js"></script>
<script src="assets/js/lunr.js"></script>
<script src="assets/js/search.js"></script>