aboutsummaryrefslogtreecommitdiff
path: root/docs/search.html
blob: 20cccc11fbd63c4240eda4f9b986dd5737f447d5 (plain) (blame)
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
---
layout: search
title: "Search"
---
<h1 id="search">Search Results</h1>

<form id="search-bar" action="/search.html" method="get">
    <input placeholder="Search" type="text" id="search-box" name="query">
</form>

<ul id="search-results"></ul>

<script>
    window.store = {
        {% for post in site.posts %}
        "{{ post.url | slugify }}": {
            "title": "{{ post.title | xml_escape }}",
            "author": "{{ post.author | xml_escape }}",
            "content": {{ post.content | markdownify | strip_html | lstrip | jsonify }},
            "url": "{{ post.url | xml_escape }}"
        },
        {% endfor %}
        {% for page in site.html_pages  %}
        "{{ page.url | slugify }}": {
            "title": "{{ page.title | xml_escape }}",
            "name": "{{ page.name | xml_escape }}",
            "content": {{ page.content | markdownify | strip_html | lstrip | jsonify }},
            "url": "{{ page.url | xml_escape }}"
        }
        {% unless forloop.last %},{% endunless %}
        {% endfor %}
    };
</script>
<script src="/js/elasticlunr.min.js"></script>
<script src="/js/search.js"></script>