-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
38 lines (35 loc) · 1.24 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
---
layout: default
---
<div class="graybg">
<div class="titleheader">
<h3>Hasil pencarian dari keyword : <span id="keyword"></span></h3>
</div>
<div class="listrecent listrelated">
<div id="search-results"></div>
</div>
</div>
<script>
window.store = {
{% for post in site.posts %}
"{{ post.url | slugify }}": {
"title": "{{ post.title | xml_escape }}",
"author": "{{ post.author | xml_escape }}",
"category": "{{ post.categories | xml_escape }}",
"content": {{ post.content | strip_html | strip_newlines | split:"<!-- more -->" | first | truncate:300 | jsonify }},
"url": "{{ post.url | xml_escape }}",
"date": "{{ post.date | date: '%-d %b %Y' }}",
{% assign words = post.content | number_of_words %}
{% if words < 270 %}
"read" : "1 min read",
{% else %}
"read" : "{{ words | divided_by:135 }} mins read",
{% endif %}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
<script src="{{ "/assets/js/jquery.min.js" | prepend: site.baseurl }}"></script>
<script src="https://unpkg.com/lunr/lunr.js"></script>
<script src="{{ "/assets/js/search.js" | prepend: site.baseurl }}"></script>