1. Home
  2. Liquid
  3. Dynamic collection navigation

Simple loop getting name, permalink and a number of posts for each collection type.

#liquid#navigation#collections#snippet
<ul>
 {% for item in site.collections  %}
  <li>
      <a href="/ {{ item.permalink  }}" title="{{ item.label }}">
        {{ item.label }} ({{ site[item.label] | size }})
      </a>
  </li>
 {% endfor  %}
</ul>
copy
Full Liquid cheatsheet