]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Fix docs/search.json. 18432/head
authorXhmikosR <xhmikosr@gmail.com>
Sat, 5 Dec 2015 08:18:18 +0000 (10:18 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Sat, 5 Dec 2015 09:30:27 +0000 (11:30 +0200)
* 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]

docs/search.json

index a31fc7334c5ddd1e4b26d8199bc7f41c605f75c5..7cd8517bc9e1746962a46fe2df4f9f28b00a780b 100644 (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 %}
 ]