{# Module: single page index, split by a "key" #}
{% extends "page.html" %}
{% block head_title -%}
  {{ _("Index") }} - {{ docstitle|striptags|e }}
{%- endblock head_title %}
{% macro indexentries(firstname, links) -%}
  {% if links -%}
    
      {%- if links[0][0] %}{% endif -%}
      {{ firstname|e }}
      {%- if links[0][0] %}{% endif -%}
    
    {%- for ismain, link in links[1:] -%}
      , 
        {%- if ismain %}{% endif -%}
        [{{ loop.index }}]
        {%- if ismain %}{% endif -%}
      
    {%- endfor %}
  {%- else %}
    {{ firstname|e }}
  {%- endif %}
{% endmacro %}
{% block content %}
  
{% block content_inner %}
  {% trans key=key %}Index – {{ key }}{% endtrans %}
  
    {%- for column in entries|slice(2) if column %}
    | {%- endfor %}
      {%- for entryname, (links, subitems, _) in column %}
        {{ indexentries(entryname, links) }}
        {%- if subitems %}
        {%- endfor %}
        {%- for subentryname, subentrylinks in subitems %}
          {%- endif -%}{{ indexentries(subentryname, subentrylinks) }}{%- endfor %} | 
{% endblock content_inner %}
 
{% endblock %}