-
Notifications
You must be signed in to change notification settings - Fork 74
/
search.html
192 lines (175 loc) · 7.51 KB
/
search.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
---
title: Search
sitemap: false
permalink: /search/
# These ids have their own index based on /_data/**/*.yml so they do not need to
# be indexed by the first site.collection pass.
data_defined_ids:
- apidefinitions
- apidefinitions-account-by-key-api
- apidefinitions-account-history-api
- apidefinitions-block-api
- apidefinitions-broadcast-ops
- apidefinitions-condenser-api
- apidefinitions-database-api
- apidefinitions-debug-node-api
- apidefinitions-follow-api
- apidefinitions-jsonrpc
- apidefinitions-market-history-api
- apidefinitions-network-broadcast-api
- apidefinitions-rc-api
- apidefinitions-reputation-api
- apidefinitions-rewards-api
- apidefinitions-tags-api
- apidefinitions-transaction-status-api
- apidefinitions-witness-api
- tutorials-recipes-understanding-dynamic-global-properties
- tutorials-recipes-understanding-configuration-values
- glossary-index
- glossary-api
- glossary-chain-basics
- glossary-governance
- glossary-market
- glossary-transactions
---
<div class="search-page">
<h2>Search Results</h2>
<p><span id="search-process">Loading</span> results <span id="search-query-container" style="display: none;">for "<strong id="search-query"></strong>"</span></p>
<ul id="search-results"></ul>
</div>
<script>
window.data = {
{% for collection in site.collections %}
{% for item in collection.docs %}
{% assign item_id = item.id | strip | slugify %}
{% unless page.data_defined_ids contains item_id %}
{% if item.title %}
{% unless item.excluded_in_search %}
{% if added %},{% endif %}
{% assign added = false %}
"{{ item_id }}": {
"id": "{{ item_id }}",
"title": "{{ item.title | strip | xml_escape }}",
"category": "{{ collection.label | strip | xml_escape }}",
"description": "{{ item.description | strip | xml_escape }}",
"type": "{{ item.type | strip | xml_escape }}",
"url": "{{ item.url | strip }}",
"content": {{ item.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
}
{% assign added = true %}
{% endunless %}
{% endif %}
{% endunless %}
{% endfor %}
{% endfor %}
// # data_defined_ids is as follows
{% for api_defs in site.data.apidefinitions %}
{% for sections in api_defs[1] %}
{% for method in sections.methods %}
{% if added %},{% endif %}
{% assign added = false %}
{% assign api_defs_url = '../apidefinitions/#' | append: method.api_method %}
"{{ method.api_method | strip | slugify }}": {
"id": "{{ method.api_method | strip | slugify }}",
"title": "{{ method.api_method | strip | xml_escape }}",
"category": "apidefinitions",
"description": "{{ method.api_method | strip | xml_escape }}",
"type": "method",
"url": "{{ api_defs_url | relative_url }}",
"content": {{ method.purpose | liquify | markdownify | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }},
"keywords": "{{ method | keywordify: 'subtract', method.purpose }}"
}
{% assign added = true %}
{% endfor %}
{% endfor %}
{% endfor %}
{% for sections in site.data.apidefinitions.broadcast_ops %}
{% for op in sections.ops %}
{% if added %},{% endif %}
{% assign added = false %}
{% assign api_defs_url = '../apidefinitions/#broadcast_ops_' | append: op.name %}
"broadcast_ops_{{ op.name | strip | slugify }}": {
"id": "broadcast_ops_{{ op.name | strip | slugify }}",
"title": "{{ op.name | strip | xml_escape }}",
"category": "broadcastops",
"description": "{{ op.name | strip | xml_escape }}",
"type": "op",
"url": "{{ api_defs_url | relative_url }}",
"content": {{ op.purpose | liquify | markdownify | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }},
"keywords": "{{ op | keywordify: 'subtract', op.purpose }}"
}
{% assign added = true %}
{% endfor %}
{% endfor %}
{% for sections in site.data.objects.dgpo %}
{% for field in sections.fields %}
{% if added %},{% endif %}
{% assign added = false %}
{% if field.purpose %}
{% assign dgpo_url = '../tutorials-recipes/understanding-dynamic-global-properties#' | append: field.name %}
{% else %}
{% assign dgpo_url = '../tutorials-recipes/understanding-dynamic-global-properties#not-covered' %}
{% endif %}
"dgpo_{{ field.name | strip | slugify }}": {
"id": "dgpo_{{ field.name | strip | slugify }}",
"title": "{{ field.name | strip | xml_escape }}",
"category": "dgpo",
"description": "{{ field.name | strip | xml_escape }}",
"type": "dgpo",
"url": "{{ dgpo_url | relative_url }}",
"content": {{ field.purpose | liquify | markdownify | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }},
"keywords": "{{ field | keywordify: 'subtract', field.purpose }}"
}
{% assign added = true %}
{% endfor %}
{% endfor %}
{% for sections in site.data.objects.config %}
{% for field in sections.fields %}
{% if added %},{% endif %}
{% assign added = false %}
{% if field.purpose %}
{% assign config_url = '../tutorials-recipes/understanding-configuration-values#' | append: field.name %}
{% else %}
{% assign config_url = '../tutorials-recipes/understanding-configuration-values#not-covered' %}
{% endif %}
"config_{{ field.name | strip | slugify }}": {
"id": "config_{{ field.name | strip | slugify }}",
"title": "{{ field.name | strip | xml_escape }}",
"category": "config",
"description": "{{ field.name | strip | xml_escape }}",
"type": "config",
"url": "{{ config_url | relative_url }}",
"content": {{ field.purpose | liquify | markdownify | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }},
"keywords": "{{ field | keywordify: 'subtract', field.purpose }}"
}
{% assign added = true %}
{% endfor %}
{% endfor %}
{% for sections in site.data.glossary.index %}
{% for item in sections.items %}
{% if added %},{% endif %}
{% assign added = false %}
{% assign term_id = item.term | strip | slugify %}
{% assign glossary_url = '../glossary#' | append: term_id %}
"glossary_{{ item.term | strip | slugify }}": {
"id": "glossary_{{ term_id }}",
"title": "{{ item.term | strip | xml_escape }}",
"category": "glossary",
"description": "{{ item.term | strip | xml_escape }}",
"type": "glossary",
"url": "{{ glossary_url | relative_url }}",
"content": {{ item.def | liquify | markdownify | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }},
"keywords": "{{ item | keywordify: 'subtract', item.def }}"
}
{% assign added = true %}
{% endfor %}
{% endfor %}
};
</script>
{% if jekyll.environment == 'production' %}
<script src="{{ '/js/lunr.min.js' | relative_url }}"></script>
<script src="{{ '/js/search.js' | relative_url }}"></script>
{% else %}
<script src="{{ '/js/lunr.min.js' | relative_url }}"></script>
<script src="{{ '/js/search.js' | relative_url }}"></script>
{% endif %}