{% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %}
{% unless category == '0' %}
  <span>
    <i class="icon-tags"></i>
    <ul class="tags unstyled">
    {% if post %}
      {% for item in post.categories %}
        <li>{{ item | category_link }}</li>
      {% endfor %}
    {% else %}
      {% for item in page.categories %}
        <li>{{ item | category_link }}</li>
      {% endfor %}
    {% endif %}
    </ul>
  </span>
{% endunless %}