Glossary

This implements an A-Z index to attach to a view.

A (2) | B (12) | C (8) | D (2) | E (4)
Markup Details
                            {%
  set attributes = attributes ? attributes.addClass('glossary')  : ' class="glossary"'
%}

<section {{ attributes|raw }}>
  {% for item in glossary_items %}
    <span class="glossary--item">
      {{ item.separator }}
      <a href="{{ item.url }}">{{ item.text }}</a> ({{ item.count }})
    </span>
  {% endfor %}
</section>