-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsearch.twig
27 lines (27 loc) · 1002 Bytes
/
search.twig
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
{% include '_header.twig' %}
{% include '_body.twig' %}
<div class="search">
<input id="search" placeholder="Search" type="text" />
<a href="#" onclick="window.location = '{{ base_url }}/search/' + document.querySelector('#search').value"
>Search</a
>
</div>
{% if search_terms %}
<div class="SearchResults">
{% set search_results = pages|apply_search %} {% if search_results %}
<h2>Search results for {{ search_terms|e('html') }}</h2>
<ul>
{% for page in search_results %}
<li style="margin-bottom: 10px;">
<b><a href="{{ page.url }}?match={{ search_terms|e('html') }}">{{ page.title }}</a></b>
{% if page.description %}: {{ page.description }}{% endif %}
<br />
URL: {{ page.url }}
</li>
{% endfor %}
</ul>
{% else %}
<p>No results found for {{ search_terms|e('html') }}.</p>
{% endif %}
</div>
{% endif %} {% include '_footer.twig' %}