1
0
mirror of https://github.com/github/choosealicense.com synced 2024-07-05 17:59:37 +02:00
choosealicense.com/licenses.json

9 lines
568 B
JSON
Raw Normal View History

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