1
0
mirror of https://github.com/github/choosealicense.com synced 2024-11-05 11:18:50 +01:00
choosealicense.com/licenses.json
2014-06-17 11:41:40 -04:00

9 lines
568 B
JSON

---
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 %}]