From 267d2c96a0a565ea543dcd380401ee8f4a19b122 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Thu, 4 Jan 2018 20:52:01 -0500 Subject: [PATCH] Reduce white-space to trim down filesize --- assets/js/lunr/lunr-store.js | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/assets/js/lunr/lunr-store.js b/assets/js/lunr/lunr-store.js index cc783c01..96bdaa11 100644 --- a/assets/js/lunr/lunr-store.js +++ b/assets/js/lunr/lunr-store.js @@ -3,34 +3,34 @@ layout: null --- var store = [ - {% for c in site.collections %} - {% if forloop.last %} - {% assign l = true %} - {% endif %} - {% assign docs = c.docs | where_exp:'doc','doc.search != false' %} - {% for doc in docs %} - {% if doc.header.teaser %} - {% capture teaser %}{{ doc.header.teaser }}{% endcapture %} - {% else %} - {% assign teaser = site.teaser %} - {% endif %} + {%- for c in site.collections -%} + {%- if forloop.last -%} + {%- assign l = true -%} + {%- endif -%} + {%- assign docs = c.docs | where_exp:'doc','doc.search != false' -%} + {%- for doc in docs -%} + {%- if doc.header.teaser -%} + {%- capture teaser -%}{{ doc.header.teaser }}{%- endcapture -%} + {%- else -%} + {%- assign teaser = site.teaser -%} + {%- endif -%} { "title": {{ doc.title | jsonify }}, "excerpt": - {% if site.search_full_content == true %} + {%- if site.search_full_content == true -%} {{ doc.content | strip_html | strip_newlines | jsonify }}, - {% else %} + {%- else -%} {{ doc.content | strip_html | strip_newlines | truncatewords: 50 | jsonify }}, - {% endif %} + {%- endif -%} "categories": {{ doc.categories | jsonify }}, "tags": {{ doc.tags | jsonify }}, "url": {{ doc.url | absolute_url | jsonify }}, "teaser": - {% if teaser contains "://" %} + {%- if teaser contains "://" -%} {{ teaser | jsonify }} - {% else %} + {%- else -%} {{ teaser | absolute_url | jsonify }} - {% endif %} - }{% unless forloop.last and l %},{% endunless %} - {% endfor %} - {% endfor %}] + {%- endif -%} + }{%- unless forloop.last and l -%},{%- endunless -%} + {%- endfor -%} + {%- endfor -%}]