From 33e00d098efae382bdcce2fee002888bc9087a7f Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 17 Jun 2014 11:41:40 -0400 Subject: [PATCH] use jsonify to build license json --- licenses.json | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/licenses.json b/licenses.json index edf1a4c..f8e1a6a 100644 --- a/licenses.json +++ b/licenses.json @@ -5,24 +5,4 @@ comment: \ 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" %} - { - "title": "{{ page.title }}", - "permalink": "{{ page.permalink }}", - "featured": {% if page.featured %}true{% else %}false{% endif %}, - "description": "{{ page.description | replace: '"', '\"' }}", - "how": "{{ page.how | replace: '"', '\"' }}", - "rules": { - {% for category in site.rules %} - {% assign cat = category[0] %} - "{{ cat }}": [ - {% for rule in page[cat] %} - "{{ rule }}"{% if forloop.rindex0 > 0 %},{% endif %} - {% endfor %} - ]{% if forloop.rindex0 > 0 %},{% endif %} - {% endfor %} - }{% assign i = i | plus: 1 %} - }{% if i < count %},{% endif %} - {% endif %}{% endfor %} -] +[{% for page in site.pages %}{% if page.layout == "license" %}{{ page | jsonify }}{% assign i = i | plus: 1 %}{% if i < count %},{% endif %}{% endif %}{% endfor %}]