-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.json
19 lines (19 loc) · 1.02 KB
/
search.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
layout: null
---
[
{%- assign pages = site.pages | where_exp: "page", "page.include_in_search" %}
{%- assign objects = site.infographics | concat: site.studies | concat: site.explainers | concat: site.episodes | sort: "published" | reverse %}
{%- assign all = pages | concat: objects %}
{%- for page in all %}
{
"title" : {{ page.title | strip_html | jsonify }},
"url" : "{{ page | get_url }}",
{%- capture html %}{% include preview-block-small.html item=page %}{%- endcapture %}
"block" : {{ html | normalize_whitespace | jsonify }},
{%- assign perex = page.caption | append: " " | append: page.perex | append: " " | append: page.intro %}
"perex" : {{ perex | normalize_whitespace | strip | strip_html | strip_newlines | replace: '"', '' | jsonify }},
"content" : {{ page.content | markdownify | normalize_whitespace | strip | strip_html | strip_newlines | replace: '"', '' | slice: 0, 3000 | jsonify }}
}{%- if forloop.last %}{% else %},{% endif %}
{%- endfor %}
]