-
Notifications
You must be signed in to change notification settings - Fork 897
/
search.liquid
29 lines (29 loc) · 1.1 KB
/
search.liquid
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
28
29
---
---
[
{% for post in site.posts %}
{
"title" : "{{ post.title | strip_newlines | escape }}",
"category" : "{{ post.category }}",
"tags" : "{{ post.tags | join: ', ' | prepend: " " }}",
"url" : "{{ post.url | relative_url }}",
"date" : "{{ post.date | date: "%B %-d, %Y" }}",
"excerpt" : {{ post.content | strip_html | truncate: '250' | escape | jsonify }},
"content" : {{ post.content | strip_html | escape | jsonify }}
} {% unless forloop.last %},{% endunless %}
{% endfor %}
{% if site.portfolio.size > 0 %},{% endif %}
{% for page in site.portfolio %}
{
{% if page.title != nil %}
"title" : "{{ page.title | strip_newlines | escape }}",
"category" : "{{ page.category }}",
"tags" : "{{ page.tags | join: ', ' | prepend: " " }}",
"url" : "{{ page.url | relative_url }}",
"date" : "{{ page.date | date: "%B %-d, %Y" }}",
"excerpt" : {{ page.content | strip_html | truncate: '250' | jsonify }},
"content" : {{ page.content | strip_html | escape | jsonify }}
{% endif %}
} {% unless forloop.last %},{% endunless %}
{% endfor %}
]