1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 12:50:24 +01:00
choosealicense.com/licenses.json

9 lines
568 B
JSON
Raw Normal View History

---
comment: \
2013-10-30 19:10:25 +02:00
because the for loop is being filtered by layout, the normal rindex0 check
2013-07-16 11:33:33 -04:00
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 %}
2014-06-17 11:41:40 -04:00
[{% for page in site.pages %}{% if page.layout == "license" %}{{ page | jsonify }}{% assign i = i | plus: 1 %}{% if i < count %},{% endif %}{% endif %}{% endfor %}]