Skip to content

Instantly share code, notes, and snippets.

@shapeshed
Created February 25, 2010 23:17
Show Gist options
  • Save shapeshed/315163 to your computer and use it in GitHub Desktop.
Save shapeshed/315163 to your computer and use it in GitHub Desktop.
# Provides a category link with a count of the number of posts in
<ul>
{% for category in site.categories %}
<li id="{{ category[0] | downcase | replace:' ', '-' }}"><a href="/{{ category[0] }}/">{{category[0] | capitalize }}</a> <span>{{ category[1] | size }}</span></li>
{% endfor %}
</ul>
# .. and the same for tags
<dl>
{% for tag in site.tags %}
<dt id='{{ tag[0] | downcase | replace:' ', '-' }}'>{{tag[0]}} ({{tag[1] | size }})</dt>
{% for post in tag[1] %}
<dd><a href="{{ post.url }}/">{{ post.title }}</a></dd>
{% endfor %}
{% endfor %}
</dl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment