{% macro show_authors(authors) %} {% for author in authors %} {% set idx = loop %} {{author.get("a")}} {{idx.index}} {% endfor %} {%- endmacro %}