---

---
// builds lunr
var index = lunr(function () {
  this.field('title')
  this.field('content', {boost: 10})
  this.field('category')
  this.field('tags')
  this.ref('id')

{% assign count = 0 %}
{% for post in site.posts %}
this.add({
  title: {{post.title | jsonify}},
  category: {{post.category | jsonify}},
  content: {{post.content | strip_html | jsonify}},
  tags: {{post.tags | jsonify}},
  id: {{count}}
});
 {% assign count = count | plus: 1 %}
 {% endfor %}
  
  
})

;



 
 
console.log( jQuery.type(index) );

  
  // builds reference data


var store = [{% for post in site.posts %}{
{% assign plink = post.url | prepend:'/blog'   %}
//{% assign pimage = post.image | prepend:'/blog/posts/'   %}
             
  "title": {{post.title | jsonify}},
  "link": {{ plink | jsonify}},
//  "image": {{ pimage | jsonify }},
  "image": {{ post.image | jsonify }},
  "date": {{ post.date | date: '%B %-d, %Y' | jsonify }},
  "category": {{ post.category | jsonify }},
  "excerpt": {{ post.content | strip_html | truncatewords: 20 | jsonify }}
}{% unless forloop.last %},{% endunless %}{% endfor %}]


// builds search
$(document).ready(function() {
  $('input#search').on('keyup', function () {
    var resultdiv = $('#results');
    // Get query
    var query = $(this).val();
    // Search for it
    var result = index.search(query);
    // Show results
    resultdiv.empty();
    // Add status
    resultdiv.prepend('<p class="">Found '+result.length+' result(s)</p>');
    // Loop through, match, and add results
    for (var item in result) {
      var ref = result[item].ref;
      var searchitem = '<div class="result"><img src="'+store[ref].image+'"  class="result-img"><div class="result-body"><a href="'+store[ref].link+'" class="post-title">'+store[ref].title+'</a><div class="post-date small">'+store[ref].category+' &times; '+store[ref].date+'</div><p>'+store[ref].excerpt+'</p></div>';
//alt="'+store[ref].title+'"
      resultdiv.append(searchitem);
    }
  });
});

---

---
// builds lunr
var index = lunr(function () {
  this.field('title')
  this.field('content', {boost: 10})
  this.field('category')
  this.field('tags')
  this.ref('id')

{% assign count = 0 %}
{% for post in site.posts %}
this.add({
  title: {{post.title | jsonify}},
  category: {{post.category | jsonify}},
  content: {{post.content | strip_html | jsonify}},
  tags: {{post.tags | jsonify}},
  id: {{count}}
});
 {% assign count = count | plus: 1 %}
 {% endfor %}
  
  
})

;



 
 
console.log( jQuery.type(index) );

  
  // builds reference data


var store = [{% for post in site.posts %}{
//{% assign plink = post.url | prepend:'/blog'   %}
//{% assign pimage = post.image | prepend:'/blog/posts/'   %}
             
  "title": {{post.title | jsonify}},
//  "link": {{ plink | jsonify}},
   "link": {{ post.url | jsonify}},
//  "image": {{ pimage | jsonify }},
  "image": {{ post.image | jsonify }},
  "date": {{ post.date | date: '%B %-d, %Y' | jsonify }},
  "category": {{ post.category | jsonify }},
  "excerpt": {{ post.content | strip_html | truncatewords: 20 | jsonify }}
}{% unless forloop.last %},{% endunless %}{% endfor %}]


// builds search
$(document).ready(function() {
  $('input#search').on('keyup', function () {
    var resultdiv = $('#results');
    // Get query
    var query = $(this).val();
    // Search for it
    var result = index.search(query);
    // Show results
    resultdiv.empty();
    // Add status
    resultdiv.prepend('<p class="">Found '+result.length+' result(s)</p>');
    // Loop through, match, and add results
    for (var item in result) {
      var ref = result[item].ref;
      var searchitem = '<div class="result"><img src="'+store[ref].image+'"  class="result-img"><div class="result-body"><a href="'+store[ref].link+'" class="post-title">'+store[ref].title+'</a><div class="post-date small">'+store[ref].category+' &times; '+store[ref].date+'</div><p>'+store[ref].excerpt+'</p></div>';
//alt="'+store[ref].title+'"
      resultdiv.append(searchitem);
    }
  });
});

Update lunr-feed.js