<script id=“searchJSON”> [

{% for post in site.posts %}
  {

    "title"    : "{{ post.title | escape }}",
    "url"      : "{{ site.baseurl }}{{ post.url }}",
    "category" : "{{ post.category }}",
    "tags"     : "{{ post.tags | join: ', ' }}",
    "date"     : "{{ post.date }}",
    "desc"     : "{{ post.title | escape }}"

  } {% unless forloop.last %},{% endunless %}
{% endfor %}

] </script>

<script> SimpleJekyllSearch({

searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: JSON.parse(document.getElementById('searchJSON').innerText)

}) </script>