-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.json
More file actions
30 lines (27 loc) · 1.21 KB
/
Copy pathsearch.json
File metadata and controls
30 lines (27 loc) · 1.21 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
---
layout: null
---
{%- comment -%}
The client-side search index. Every post, as plain text.
`plain_text` is _plugins/search_index.rb, replacing `strip_html |
strip_newlines`: it decodes HTML entities (kramdown escapes a literal `>` to
`>`, which the result card used to print verbatim) and leaves a space at
block boundaries (`<p>끝</p><p>시작</p>` had been indexing as one token).
There is no separate `snippet` field. It held the first 40 words, which is not
where a match usually is — js/search.js cuts the shown excerpt around the match
in `content` instead.
Every field here is searched: simple-jekyll-search walks each key and matches a
post when all query words appear in one of them.
{%- endcomment -%}
[
{% for post in site.posts %}
{
"title": {{ post.title | jsonify }},
"url": "{{ site.baseurl }}{{ post.url }}",
"date": "{{ post.date | date: '%Y-%m-%d' }}",
"category": "{% if post.categories %}{{ post.categories | join: ', ' }}{% endif %}",
"tags": "{% if post.tags %}{{ post.tags | join: ', ' | replace: '-', ' ' }}{% endif %}",
"content": {{ post.content | plain_text | jsonify }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]