Repository navigation
Expand file tree
/
Copy pathsearch.json
More file actions
37 lines (37 loc) · 1.41 KB
/
Copy pathsearch.json
File metadata and controls
37 lines (37 loc) · 1.41 KB
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
31
32
33
34
35
36
37
---
layout: null
permalink: /search.json
---
{%- comment -%}
Search index. Same as the theme's own, except that the How to book guide is left out:
it is written for end customers and should not show up in searches of the manual.
{%- endcomment -%}
[
{%- assign first = true -%}
{%- assign home_page = site.pages | where: 'url', '/' | first -%}
{%- if home_page -%}
{%- assign home_excerpt = home_page.content | markdownify | strip_html | strip_newlines | replace: ' ', ' ' | strip | truncate: 2400, '' -%}
{
"title": {{ home_page.title | default: site.title | strip_html | strip | jsonify }},
"url": {{ home_page.url | relative_url | jsonify }},
"content": {{ home_excerpt | jsonify }}
}
{%- assign first = false -%}
{%- endif -%}
{%- for group in site.data.sidebar -%}
{%- if group.collection == 'customers' -%}{%- continue -%}{%- endif -%}
{%- assign docs = site[group.collection] | sort: 'nav_order' -%}
{%- for doc in docs -%}
{%- if doc.title and doc.url -%}
{%- unless first -%},{%- endunless -%}
{%- assign excerpt = doc.content | markdownify | strip_html | strip_newlines | replace: ' ', ' ' | strip | truncate: 2400, '' -%}
{
"title": {{ doc.title | strip_html | strip | jsonify }},
"url": {{ doc.url | relative_url | jsonify }},
"content": {{ excerpt | jsonify }}
}
{%- assign first = false -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
]