-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.json
More file actions
20 lines (20 loc) · 804 Bytes
/
search.json
File metadata and controls
20 lines (20 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
layout: null
---
{% assign help_pages = site.pages | where_exp: "p", "p.url contains '/help/'" | where_exp: "p", "p.url != '/search.json'" | where_exp: "p", "p.url != '/search-index.json'" | where_exp: "p", "p.url != '/404.html'" | where_exp: "p", "p.url != '/404/'" %}
{% if help_pages.size > 0 %}
[
{% for p in help_pages %}
{% assign content_clean = p.content | strip_html | normalize_whitespace | truncate: 500 %}
{% if content_clean == blank %}{% assign content_clean = p.title | default: 'Untitled' %}{% endif %}
{
"id": "{{ forloop.index }}",
"title": {{ p.title | default: 'Untitled' | jsonify }},
"url": {{ p.url | relative_url | jsonify }},
"content": {{ content_clean | jsonify }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
{% else %}
[]
{% endif %}