{% macro toc_loop(items) %} {% import _self as self %} {% for item in items %} {% set class = loop.first ? 'first' : loop.last ? 'last' : null %}