content/bridgetown_quick_search/index.json in bridgetown-quick-search-1.0.2 vs content/bridgetown_quick_search/index.json in bridgetown-quick-search-1.0.3

- old
+ new

@@ -1,11 +1,13 @@ --- --- [ + {%- assign looped = false %} {%- for document in site.documents %} {%- if document.title %} {%- unless document.exclude_from_search %} + {%- if looped %},{% endif %} { "id": "{{ document.url | slugify }}", "title": {{ document.title | jsonify }}, {%- if document.collection %} "collection": { @@ -15,10 +17,28 @@ {%- endif %} "categories": {{ document.categories | join: ", " | jsonify }}, "tags": {{ document.tags | join: ", " | jsonify }}, "url": {{ document.url | jsonify }}, "content": {{ document.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }} - }{% unless forloop.last %},{% endunless %} + } + {%- assign looped = true %} {%- endunless %} + {%- endif %} + {%- endfor %} + {%- for document in site.pages %} + {%- if document.name contains ".md" or document.name contains ".html" %} + {%- if document.title %} + {%- unless document.exclude_from_search %} + {%- if looped %},{% endif %} + { + "id": "{{ document.url | slugify }}", + "title": {{ document.title | jsonify }}, + "categories": {{ document.categories | join: ", " | jsonify }}, + "tags": {{ document.tags | join: ", " | jsonify }}, + "url": {{ document.url | jsonify }}, + "content": {{ document.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }} + } + {%- endunless %} + {%- endif %} {%- endif %} {%- endfor %} ]