Loop through data file with "uniq" array filter

Another way to get this done is as follows:

{% assign titles = site.data.elements | map: 'title' | uniq %}

<ul>
  {% for item in titles %}
    <li>{{ item }}</li>
  {% endfor %}
</ul>

2 Likes