Goes in the navigation bar
<form class="search" action="/search/" method="get">
<input type="text" id="search-box" name="query">
<input type="submit" value="search">
</form>
Goes on the search page
<form class="search-page-search" action="/search/" method="get">
<input type="text" id="search-box" name="query" placeholder="Search...">
<input type="submit" value="search">
</form>
<ul id="search-results"></ul>
<script>
window.store = {
{% for post in site.pages %}
"{{ post.url | slugify }}": {
"title": {{ post.titletag | xml_escape | strip_newlines | jsonify }},
"category": "{{ post.category | xml_escape }}",
//"content": {{ post.content | strip_html | strip_newlines | jsonify }},
"description": {{post.description | xml_escape | strip_newlines | jsonify }},
"url": "{{ post.url | xml_escape }}"
}
,{% endfor%}
{% for post in site.posts %}
"{{ post.url | slugify }}": {
"title": {{ post.titletag | xml_escape | strip_newlines | jsonify }},
"category": "{{ post.category | xml_escape }}",
//"content": {{ post.content | strip_html | strip_newlines | jsonify }},
"description": {{post.description | xml_escape | strip_newlines | jsonify }},
"url": "{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
<script src="/assets/js/lunr.min.js"></script>
<script src="/assets/js/search.js"></script>
/****************
SEARCH BAR
****************/
form.search {position: absolute;right: 25vw;}
#search-box {font-size: 1vw;padding-left: .5vw;}
input[type="submit"] {font-size: 1vw;text-transform: capitalize;background: #b32722;color: white;padding: 0 .5vw;border: solid #b32722;}