Fix docs/search.json.

* only loop through `html_pages`
* skip pages without a title
* stop double escaping the title; use Jekyll's `jsonify` filter to output valid JSON
* remove `date` since we don't use it

[skip sauce]
This commit is contained in:
XhmikosR 2015-12-05 10:18:18 +02:00
parent 4e7c7f4b9d
commit 3afdbe426f
1 changed files with 7 additions and 5 deletions

View File

@ -3,11 +3,13 @@
---
[
{% for page in site.pages %}
{% assign sorted_pages = site.html_pages | sort: 'title' %}
{% for page in sorted_pages %}
{% if page.title %}
{
"title" : "{{ page.title | escape }}",
"url" : "{{ site.baseurl }}{{ page.url }}",
"date" : "{{ page.date }}"
"title" : {{ page.title | jsonify }},
"url" : "{{ site.baseurl }}{{ page.url }}"
} {% unless forloop.last %},{% endunless %}
{% endfor %}
{% endif %}
{% endfor %}
]