Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (32 sloc) 1.17 KB
---
layout: none
---
{% capture tags %}
{% for tag in site.tags %}
{{ tag[0] }}
{% endfor %}
{% endcapture %}
{%- assign sortedtags = tags | split:' ' | sort -%}
{
"nodes": [{% for tag in site.tags %}{% assign t = tag | first %}{% assign posts = tag | last %}
{
"id": "{{ tag[0] }}",
"group": {{ forloop.index }},
"posts": "{% for post in posts %}{% if post.tags contains t %}↳ {{ post.title }}{% endif %}{% unless forloop.last %}\n{% endunless %}{% endfor %}"
}{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}],
"links": [{% for sourcetag in sortedtags %}
{%- assign lastsource = forloop.last -%}
{%- for post in site.tags[sourcetag] -%}
{%- assign lastpost = forloop.last -%}
{%- for targettag in post.tags -%}
{%- assign lasttag = forloop.last -%}
{
"source" : "{{ sourcetag }}",
"target" : "{{ targettag }}",
"value": 1
}{%- unless lastsource and lastpost and lasttag -%},{%- endunless -%}
{%- endfor -%}
{%- endfor -%}
{% endfor %}]
}