Skip to content

Instantly share code, notes, and snippets.

@e30chris
Created November 27, 2013 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e30chris/7669102 to your computer and use it in GitHub Desktop.
Save e30chris/7669102 to your computer and use it in GitHub Desktop.
category_list.html aside for Octopress
<section class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Categories</h3>
</div>
<div class="list-group">
{% for category in site.categories %}
{% capture category_url %}{{ site.category_dir }}/{{ category | first | slugize | downcase | replace:' ','-' | append:'/index.html'}}{% endcapture %}
<a class="list-group-item {% if category_url == page.url %}active{% endif %}" href="{{ root_url | append:'/' | append:category_url }}">
<span class="badge">{{ category | last | size }}</span>
{{ category | first }}
</a>
{% endfor %}
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment