1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

jsonify licenses.json

This commit is contained in:
Ben Balter 2014-07-31 12:39:58 -04:00
parent 22cc77f12b
commit c1cd6f08ac

View File

@ -1,8 +1,3 @@
---
comment: \
because the for loop is being filtered by layout, the normal rindex0 check
for the trailing comma doesn't work. Count the number of licenses and manually
increment an index to see if we're on the true last iteration.
---
{% assign count = 0 %}{% for page in site.pages %}{% if page.layout == "license" %}{% assign count = count | plus: 1 %}{% endif %}{% endfor %}{% assign i = 0 %}
[{% for page in site.pages %}{% if page.layout == "license" %}{{ page | jsonify }}{% assign i = i | plus: 1 %}{% if i < count %},{% endif %}{% endif %}{% endfor %}]
{{ site.licensees | jsonify }}