Skip to content

Instantly share code, notes, and snippets.

@luhonghai
Created June 11, 2014 08:52
Show Gist options
  • Save luhonghai/d5e917a9761c08f19225 to your computer and use it in GitHub Desktop.
Save luhonghai/d5e917a9761c08f19225 to your computer and use it in GitHub Desktop.
<section class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-tags"></span>&nbsp;&nbsp;Tags</h3>
</div>
<div style="padding: 5px;">
<ul class="nav nav-pills">
{% for category in site.tags %}
{% capture tag_url %}{{ site.tag_dir }}/{{ category | first | slugize | downcase | replace:' ','-' | append:'/index.html'}}{% endcapture %}
<li {% if tag_url == page.url %}class='active'{% endif %}>
{% capture tag-size %}{{ category | last | size }}{% endcapture %}
<a class="{% if tag-size > 20 %}tags-20{% elsif tag-size > 15 %}tags-15{% elsif tag-size > 10 %}tags-10{% elsif tag-size > 5 %}tags-5{% else %}tags-1{% endif %}"
href="{{ root_url | append:'/' | append:tag_url }}">
<span class="badge pull-right">{{ category | last | size }}</span>
{{ category | first }}
</a>
</li>
{% endfor %}
</ul>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment