Add Lunr Search (#1353)

* Add `search.html` layout and JavaScript
* Move `{{ content }}` before search input
* Add spaces for consistency

Close #1011
This commit is contained in:
Nick Garlis
2017-11-15 21:43:31 +02:00
committed by Michael Rose
parent 7978376df0
commit cc3b21bc86
7 changed files with 154 additions and 0 deletions

30
_layouts/search.html Normal file
View File

@ -0,0 +1,30 @@
---
layout: default
---
{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
{% include page__hero.html %}
{% endif %}
{% if page.url != "/" and site.breadcrumbs %}
{% unless paginator %}
{% include breadcrumbs.html %}
{% endunless %}
{% endif %}
<div id="main" role="main">
{% include sidebar.html %}
<div class="archive">
{% unless page.header.overlay_color or page.header.overlay_image %}
<h1 class="page__title">{{ page.title }}</h1>
{% endunless %}
{{ content }}
<input placeholder="Search..." type="search" id="search" class="search-input">
<div id="results"></div>
</div>
</div>