Use unless loop for comma

and mention `search_exclude`
This commit is contained in:
EricFromCanada
2019-01-15 20:48:00 -05:00
parent 71ba32e131
commit 793ea356c3
3 changed files with 5 additions and 5 deletions

View File

@@ -37,13 +37,13 @@ This command creates the `search-data.json` file that Jekyll uses to create your
{% raw %}---
---
{
{% for page in site.html_pages %}"{{ forloop.index0 }}": {
{% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
"id": "{{ forloop.index0 }}",
"title": "{{ page.title | xml_escape }}",
"content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | remove: page.title | strip_newlines | replace: '\', ' '}}",
"url": "{{ page.url | absolute_url | xml_escape }}",
"relUrl": "{{ page.url | xml_escape }}"
}{% if forloop.last %}{% else %},
}{% unless forloop.last %},{% endunless %}
{% endif %}{% endfor %}
}{% endraw %}
```