modifier: bengillies.net created: 20090602092310 modified: 20091007092310 type: None tags: {% macro join_queries(queries) %} {% for query_el in queries %} {{query_el}}={{queries[query_el]}}& {% endfor %} {% endmacro %} {% if 'limit' in query %} {% set page_info = query.pop('limit').split(',') %} {% if page_info|length == 2 %} {% set index, count = (page_info[0]|int, page_info[1]|int) %} {% else %} {% set index, count = (-1, page_info[0]|int) %} {% endif %} {% set default_count = count-1 %} {% else %} {% set index, default_count = (-1, 3) %} {% endif %} {% set base_count = base|count %} {% for tiddler in base %} {% if base.index(tiddler) < base_count - 1 or base_count <= default_count or (index == -1 and base_count > default_count + 1) %}
{% include "SingleTiddler" %}
{% endif %} {% endfor %}