{%macro print(name, pages)%} <h2>{{name}}</h2> <ul class="page-list"> {%for p in pages%} {%if loop.previtem%} {%if loop.previtem.cdate('list_sep_date') != p.cdate('list_sep_date')%} <h3>{{p.cdate('list_sep_date')}}</h3> {%endif%} {%else%} <h3>{{p.cdate('list_sep_date')}}</h3> {%endif%} <li><span class="page-list-item">{{p.cdate('list_date')}}</span> - <a href="{{p.url}}">{{p.title}}</a></li> {%endfor%} </ul> {%endmacro%}