-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-search.hbs
38 lines (38 loc) · 1.28 KB
/
page-search.hbs
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
{{!< default}}
<main class="site-main wow fadeIn" data-wow-duration=".8s" role="main">
<style type="text/css">
form>input[type='submit'] {
padding: 6px 12px;
font-size: 14px;
display: block;
background: #275b8c;
border-radius: 4px;
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,.2);
line-height: 1.42857143;
box-shadow: none;
border:none;
cursor: pointer;
}
#results {
min-height: 200px;
}
</style>
<form>
<input type="text" id="search-field" placeholder="Search"/>
<input type="submit" value="开始搜索">
</form>
<section id="results"></section>
<script type="text/javascript">
window.onload = function () {
$.getScript('{{asset "js/min/jquery.ghostHunter.min.js"}}', function (data, textStatus, jqxhr) {
$("#search-field").ghostHunter({
results: "#results",
onKeyUp: true,
info_template : "<p>共找到: \{{amount}} 篇文章</p>",
result_template:"<li><a href='{{@blog.url}}/\{{link}}'>\{{title}}</a></li>"
});
});
}
</script>
</main>