-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.json
30 lines (28 loc) · 1.01 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
28
29
30
---
layout: none
---
{% assign posts_with_title = site.posts | where_exp: "post", "post.title != nil" %}
{% assign pages_with_title = site.pages | where_exp: "page", "page.title != nil" %}
[
{%- for post in posts_with_title -%}
{
"title" : "{{ post.title | escape }}",
"category" : "{{ post.category }}",
"tags" : "{{ post.tags | join: ', ' }}",
"url" : "{{ site.baseurl }}{{ post.url }}",
"date" : "{{ post.date }}",
"content" : "{{ post.content | strip_html | strip_newlines | replace: '"', "'" }}"
} {%- unless forloop.last -%},{% endunless %}
{% endfor %}
,
{%- for page in pages_with_title -%}
{
"title" : "{{ page.title | escape }}",
"category" : "{{ page.category }}",
"tags" : "{{ page.tags | join: ', ' }}",
"url" : "{{ site.baseurl }}{{ page.url }}",
"date" : "{{ page.date }}",
"content" : "{{ page.content | strip_html | strip_newlines | replace: '"', "'" }}"
} {%- unless forloop.last -%},{% endunless %}
{% endfor %}
]