{# Display a list of all tags with post counts. Params: ord=desc, items=0 #}
{% macro tags(ord="desc", items=0) %}
{% set tag_map = group(kind="tag", ord=ord, items=items) %}
<ul class="tags-list">
{% for tag_name, posts in tag_map %}
{% set tag_slug = tag_name | slugify %}
<li><a href="{{ url_for(path='tag-' ~ tag_slug ~ '.html') }}">{{ tag_name }}</a> ({{ posts | length }} posts)</li>
{% endfor %}
</ul>
{% endmacro tags %}