-
Notifications
You must be signed in to change notification settings - Fork 12
/
search.json
27 lines (26 loc) · 1.25 KB
/
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
26
27
---
sitemap: false
---
[{% for collection in site.collections %}{% assign posts = site[collection.label] %}{% for post in posts %}{% if post.title != null and post.title != empty and post.search_omit != true %}
{
"title": {{ post.title | jsonify }},
"link": "{{ site.baseurl }}{{ post.url }}",
"date": "{{ post.date | date: "%B %d, %Y" }}",
"excerpt": "{{ post.excerpt | markdownify | strip_html | strip_newlines | escape_once | remove: '\[' | remove: '\]' | remove: '\(' | remove: '\)' }}",
"category": "{{ post.categories | first }}",
"categories": "{{ post.categories | join: ' ' }}",
"collection": {{ collection.label | jsonify }},
"tags": "{{ post.tags | join: ', ' }}"
},{%endif%}{% endfor %}{% endfor %}
{% for page in site.pages %}{% if page.layout != 'none' and page.layout != 'none' and page.title != null and page.title != empty and page.search_omit != true %}
{
"title": {{ page.title | jsonify }},
"link": "{{ site.baseurl }}{{ page.url | replace: 'index.html', '' }}",
"date": {{ page.date | jsonify }},
"excerpt": "{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once | remove: '\[' | remove: '\]' | remove: '\(' | remove: '\)' }}"
},{%endif%}{% endfor %}{
"title": "",
"link": "",
"date": "",
"excerpt": ""
}]