Skip to content

Instantly share code, notes, and snippets.

@luhonghai
Created June 11, 2014 08:58
Show Gist options
  • Save luhonghai/46886a4870eae8b3ed25 to your computer and use it in GitHub Desktop.
Save luhonghai/46886a4870eae8b3ed25 to your computer and use it in GitHub Desktop.
{% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %}
{% unless category == '0' %}
<span class="glyphicon glyphicon-folder-open"></span>&nbsp;
<span class="categories">
{% if post %}
{{ post.categories | category_links }}
{% else %}
{{ page.categories | category_links }}
{% endif %}
</span>
{% endunless %}
{% capture tag %}{% if post %}{{ post.tags | tag_links | size }}{% else %}{{ page.tags | tag_links | size }}{% endif %}{% endcapture %}
{% unless tag == '0' %}
<span class="glyphicon glyphicon-tags"></span>&nbsp;
<span class="tags">
{% if post %}
{{ post.tags | tag_links }}
{% else %}
{{ page.tags | tag_links }}
{% endif %}
</span>
{% endunless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment