{% if include.categories != empty %} {% for category in include.categories %}

  {% assign no_comma = forloop.last %}
  {% for archive in site.archives %}
    {% if archive.type == "category" and archive.title == category %}
    <li><a href="{{ archive.url | relative_url }}">{{ archive.title | escape }}</a></li>
    {% endif %}
  {% endfor %}
{% endfor %}

{% endif %}

{% if include.tags != empty %}

{% for tag in include.tags %}
  {% assign no_comma = forloop.last %}
  {% for archive in site.archives %}
    {% if archive.type == "tag" and archive.title == tag %}
    <li><a href="{{ archive.url | relative_url }}">{{ archive.title | escape }}</a></li>
    {% endif %}
  {% endfor %}
{% endfor %}

{% endif %}