-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.json
25 lines (24 loc) · 920 Bytes
/
search.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
layout: null
---
{% assign all_documents = site.pages | concat:site.documents %}
{% assign whitelisted_documents = '' | split: '' %}
{% for doc in all_documents %}
{% if site.jekyll_search_url_blacklist contains doc.url %}
{% elsif doc.content %}
{% assign whitelisted_documents = whitelisted_documents | push: doc %}
{% endif %}
{% endfor %}
{
{% for doc in whitelisted_documents %}
"{{ doc.url | slugify }}": {
"date": "{% if doc.date and doc.author %}{{ doc.date }}{% endif %}",
"title": "{{ doc.title | xml_escape }}",
"author": "{{ doc.author | xml_escape }}",
"categories": "{% for category in doc.categories %}{{ category }}{% unless forloop.last %}, {% endunless %}{% endfor %}",
"content": {{ doc.content | strip_html | strip_newlines | jsonify }},
"url": "{{ doc.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
}