-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.json
52 lines (52 loc) · 3.64 KB
/
search.json
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
---
layout: none
---
[
{%- assign numposts = site.posts | size -%}
{%- for post in site.posts -%}
{%- assign isindexed = post.index | default: true -%}
{%- if isindexed -%}
{%- assign trailingcomma = "," -%}
{%- else -%}
{%- assign trailingcomma = "" -%}
{%- endif -%}
{%- if forloop.last -%}
{%- assign trailingcomma = "" -%}
{%- endif -%}
{%- if isindexed -%}
{%- assign desc = post.description | markdownify | strip_html | newline_to_br | replace: "<br />"," " | split: " " | compact | join: " " | escape | lstrip | rstrip -%}
{%- assign intro = post.content | markdownify | strip_html | newline_to_br | replace: "<br />"," " | split: " " | compact | join: " " | escape | lstrip | rstrip | truncatewords: 20 -%}
{%- assign keywords = post.content | markdownify | strip_html | newline_to_br | replace: "<br />"," " | replace: "."," " | replace: ","," " | replace: "?"," " | replace: "”"," " | replace: "("," " | replace: ")"," " | replace: "{"," " | replace: "}"," " | replace: "%"," " | replace: ":"," " | replace: ";"," " | replace: "/"," " | replace: "\"," " | replace: "_"," " | replace: "="," " | replace: "-"," " | replace: "1"," " | replace: "2"," " | replace: "3"," " | replace: "4"," " | replace: "5"," " | replace: "6"," " | replace: "7"," " | replace: "8"," " | replace: "9"," " | replace: "0"," " | split: " " | compact | uniq | join: " " | downcase | escape | lstrip | rstrip -%}
{
"t": "{{ post.title | escape }}",
"url": "{{ post.url | absolute_url }}",
"desc": "{{ desc }}",
"intro": "{{ intro }}",
"kw": "{{ keywords }}",
"img": "{{ post.imageurl | absolute_url }}",
"alt": "{{ post.imagealt | default: '' }}"
}{{ trailingcomma }}
{%- endif -%}
{%- endfor -%}
{%- assign firstpage = true -%}
{%- for page in site.pages -%}
{%- assign isindexed = page.index | default: false -%}
{%- assign leadingcomma = "" -%}
{%- if isindexed -%}
{%- unless numposts == 0 and firstpage == true -%}{%- assign leadingcomma = "," -%}{%- endunless -%}
{%- assign firstpage = false -%}
{%- assign desc = page.description | markdownify | strip_html | newline_to_br | replace: "<br />"," " | split: " " | compact | join: " " | escape | lstrip | rstrip -%}
{%- assign intro = page.content | markdownify | strip_html | newline_to_br | replace: "<br />"," " | replace: ":"," " | replace: "\"," " | split: " " | compact | join: " " | escape | lstrip | rstrip | truncatewords: 20 -%}
{%- assign keywords = page.content | markdownify | strip_html | newline_to_br | replace: "<br />"," " | replace: "."," " | replace: ","," " | replace: "?"," " | replace: "”"," " | replace: "("," " | replace: ")"," " | replace: "{"," " | replace: "}"," " | replace: "%"," " | replace: ":"," " | replace: ";"," " | replace: "/"," " | replace: "\"," " | replace: "_"," " | replace: "="," " | replace: "-"," " | replace: "1"," " | replace: "2"," " | replace: "3"," " | replace: "4"," " | replace: "5"," " | replace: "6"," " | replace: "7"," " | replace: "8"," " | replace: "9"," " | replace: "0"," " | split: " " | compact | uniq | join: " " | downcase | escape | lstrip | rstrip -%}
{{ leadingcomma }}{
"t": "{{ page.title | escape }}",
"url": "{{ page.url | absolute_url }}",
"desc": "{{ desc }}",
"intro": "{{ intro }}",
"kw": "{{ keywords }}",
"img": "{{ page.imageurl | absolute_url }}",
"alt": "{{ page.imagealt | default: '' }}"
}
{%- endif -%}
{%- endfor -%}
]