Skip to content

Instantly share code, notes, and snippets.

@theironsamurai
Created June 5, 2014 20:38
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 theironsamurai/eb3390d3884c4dd64b7a to your computer and use it in GitHub Desktop.
Save theironsamurai/eb3390d3884c4dd64b7a to your computer and use it in GitHub Desktop.
Tags for Jekyll with Liquid
{% capture tags %}
{% for tag in site.tags %}
{{ tag[0] }}
{% endfor %}
{% endcapture %}
{% assign sortedtags = tags | split:' ' | sort %}
{% for tag in sortedtags %}
<h3 id="{{ tag }}">{{ tag }}</h3>
<ul>
{% for post in site.tags[tag] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment