|
8 | 8 |
|
9 | 9 | <script src="https://unpkg.com/simple-jekyll-search@latest/dest/simple-jekyll-search.min.js"></script>
|
10 | 10 | <script>
|
11 |
| - var searchjson = '[ \ |
12 |
| - {% for post in site.posts %} \ |
13 |
| - { \ |
14 |
| - "title" : "{% if post.title != "" %}{{ post.title | strip_html | escape | replace: "\", "\\\" }}{% else %}{{ post.excerpt | strip_html | escape | strip | replace: "\", "\\\" }}{%endif%}", \ |
15 |
| - "desc" : "{% if post.title != "" %}{{ post.title | strip_html | escape | replace: "\", "\\\" }}{% else %}{{ post.excerpt | strip_html | escape | strip | replace: "\", "\\\" }}{%endif%}", \ |
16 |
| - "category" : "{{ post.tags | join: \', \' }}", \ |
17 |
| - "url" : "{{ site.baseurl }}{{ post.url | escape }}", \ |
18 |
| - "date" : "{{ post.date | date: "%B %e, %Y" | default: "January 1, 1970" }}" \ |
19 |
| - }, \ |
20 |
| - {% endfor %} \ |
21 |
| - {% for page in site.html_pages %}{% if page.title != "{title}" and page.title != "404 - Page not found" %} \ |
22 |
| - { \ |
23 |
| - "title" : "{% if page.title != "" %}{{ page.title | strip_html | escape }}{% else %}{{ page.excerpt | strip_html | escape | strip }}{% endif %}", \ |
24 |
| - "desc" : "{% if page.title != "" %}{{ page.title | strip_html | escape }}{% else %}{{ page.excerpt | strip_html | escape | strip }}{% endif %}", \ |
25 |
| - "category" : "{% if page.tags %}{{ page.tags | join: \', \' }}{% else %}page{% endif %}", \ |
26 |
| - "url" : "{{ site.baseurl }}{{ page.url }}", \ |
27 |
| - "date" : "{{ page.date | date: '%B %e, %Y' | default: "January 1, 1970" }}" \ |
28 |
| - }{% unless forloop.last %},{% endunless %} \ |
29 |
| - {% endif %}{% endfor %} \ |
30 |
| - ]'; |
31 |
| - searchjson = JSON.parse(searchjson); |
32 |
| - |
33 |
| - var sjs = SimpleJekyllSearch({ |
| 11 | + SimpleJekyllSearch({ |
34 | 12 | searchInput: document.getElementById('nav-search-input'),
|
35 | 13 | resultsContainer: document.getElementById('search-results-container'),
|
36 |
| - json: searchjson |
| 14 | + json: '{{ site.baseurl }}/assets/data/searchcorpus.json' |
37 | 15 | });
|
38 | 16 | </script>
|
39 | 17 | </div>
|
|
0 commit comments