{% macro tagList(tags) %}
  <span class="tags" style="--totalTags:{{ collections.categories | dictsort | length }}">
  {%- for tag in tags -%}
    {%- if tag in collections.categories -%}
    <a
      class="tag"
      style="--tagIndex:{{ collections.categories[tag].id }}"
      href="/tags/{{ tag | slugify }}"
    >{{ tag }}</a>
    {%- endif %}
  {% endfor -%}
  </span>
{% endmacro %}