layout: default
{% assign collectionName = 'projects' %} {% assign c = site.collections | where:'label', collectionName | first %} {% assign count = c.categories.size %}
{% if count == 1 %} {% assign projects = “one” %} {% elsif count == 2 %} {% assign projects = “two” %} {% elsif count == 3 %} {% assign projects = “three” %} {% else %} {% assign projects = “many” %} {% endif %}
<nav class=“{{projects}}”>
<ul> {% for category in c.categories %} <li> <a href="#{{category}}">{{category}}</a> </li> {% endfor %} </ul>
</nav>
{{content}}
<div class=“projects-content”>
{% for category in c.categories %} <section class="{{projects}}"> <h2 id="{{category}}">{{category}}</h2> <ul> {% for project in site.projects reversed %} {% if project.category contains category %} <li> <h3>{{ project.title | escape }}</h3> <p>[{{project.tags}}]</p> <p>{{project.content}}</p> </li> {% endif %} {% endfor %} </ul> </section> {% endfor %}
</div>