-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch-data.json
27 lines (27 loc) · 1.03 KB
/
search-data.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
---
skipIndexing: true
---
{% capture newline %}
{% endcapture %}
{%- assign indexedPages = site.pages | where_exp: "item", "item.skipIndexing != true" | where_exp: "item", "item.url != '/feed.xml'" -%}
{%- assign id = 0 -%}
[{% for post in site.posts %}
{
"id": "{{ id }}{% assign id = id | plus: 1 %}",
"title": "{{ post.title | xml_escape }}",
"type": "post",
"author": "{{ post.author | xml_escape }}",
"category": "{{ post.category | xml_escape }}",
"content": {{ post.content | strip_html | replace: newline, ' ' | jsonify }},
"url": "{{ post.url | xml_escape }}"
},{% endfor %}{% for page in indexedPages %}
{
"id": "{{ id }}{% assign id = id | plus: 1 %}",
"title": "{{ page.title | xml_escape }}",
"type": "page",
"author": "{{ page.author | xml_escape }}",
"category": "{{ page.category | xml_escape }}",
"content": {{ page.content | strip_html | replace: newline, ' ' | jsonify }},
"url": "{{ page.url | xml_escape }}"
}{% unless forloop.last %},{% endunless %}{% endfor %}
]