{% 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 %}
      <a href="{{ archive.url | relative_url }}">{{ archive.title | escape }}</a>{% unless no_comma %},{% endunless %}
    {% 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 %}
      <a href="{{ archive.url | relative_url }}">{{ archive.title | escape }}</a>{% unless no_comma %},{% endunless %}
    {% endif %}
  {% endfor %}
{% endfor %}

{% endif %}