-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsearch.json
55 lines (50 loc) · 1.7 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
53
54
55
---
title: search
layout: compress
search: exclude
permalink: /search.json
---
[
{% for page in site.pages %}
{% unless page.search == "exclude" %}
{
{% if page.title %}
{% assign title = page.title | strip | escape | remove: '\' %}
{% else %}
{% assign title = page.keywords | split: ',' | first %}
{% endif %}
{% assign url = page.url | remove: '/' %}
{% assign path = page.url | remove: '.html' | replace: '/', '.' | split: '.' | join: ' > ' | replace_first: ' > ' %}
{% assign date = page.last_updated | date_to_xmlschema | date: '%b %d, %Y' %}
{% assign keywords = page.keywords %}
{% assign summary = page.summary | strip | escape | truncate: 200 %}
"title" : "{{ title }}",
"url" : "{{ url }}",
"path" : "{{ path }}",
"date" : "{{ date | default: ' ' }}",
"keywords" : "{{ keywords }}",
"summary" : "{{ summary }}"
}
{% unless forloop.last and site.posts.size < 1 %},{% endunless %}
{% endunless %}
{% endfor %}
{% for post in site.posts %}
{% unless post.published == false %}
{
{% assign title = post.title | strip | escape | remove: '\' %}
{% assign url = post.url | remove: '/' %}
{% assign path = post.url | remove: '.html' | replace: '/', '.' | split: '.' | join: ' > ' | replace_first: ' > ' %}
{% assign date = post.date | date_to_xmlschema | date: '%b %d, %Y' %}
{% assign tags = post.tags %}
{% assign categories = post.categories %}
"title" : "{{ title }}",
"url" : "{{ url }}",
"path" : "{{ path }}",
"date" : "{{ date }}",
"tags" : "{{ tags }}",
"categories" : "{{ categories }}"
}
{% unless forloop.last %},{% endunless %}
{% endunless %}
{% endfor %}
]