forked from barryclark/jekyll-now
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.html
61 lines (53 loc) · 1.61 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
---
layout: default
title: Search
permalink: /search/
---
<!-- Page Header -->
{% if page.background %}
<header class="masthead" style="background-image: url('{{ page.background | prepend: site.baseurl | replace: '//', '/' }}')">
{% else %}
<header class="masthead">
{% endif %}
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="page-heading">
<h1>{{ site.title }}</h1>
{% if site.description %}
<span class="subheading">{{ site.description }}</span>
{% endif %}
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<!-- Home Post List -->
<ul id="search-results"></ul>
<script>
window.store = {
{% for post in site.posts %}
"{{ post.url | slugify }}" : {
"title": "{{ post.title | xml_escape }}",
"date": "{{ post.date | xml_escape }}",
"author": "{{ post.author | xml_escape }}",
"category": "{{ post.categories | xml_escape }}",
"content": {{ post.content | strip_html | strip_newlines | jsonify }},
"url": "{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}{% endfor %}
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/1.0.0/lunr.min.js"></script>
<script src="/assets/js/search.js"></script>
<!-- Pager -->
<div class="clearfix">
<a class="btn btn-primary float-right" href="{{"/posts" | relative_url }}">View All Posts →</a>
</div>
</div>
</div>
</div>