Skip to content

Instantly share code, notes, and snippets.

@Ovilia
Created May 18, 2014 05:09
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 Ovilia/5248cd4f9b7f50d9652b to your computer and use it in GitHub Desktop.
Save Ovilia/5248cd4f9b7f50d9652b to your computer and use it in GitHub Desktop.
Jekyll Tag Searching
{% capture tags %}
{% for tag in site.tags %}
{{ tag[0] }}
{% endfor %}
{% endcapture %}
{% assign sortedtags = tags | split:' ' | sort %}
{% for tag in sortedtags %}
<div id="tag-{{ tag }}" class="tag-posts">
{% for post in site.posts %}
{% for otag in post.tags %}
{% if tag == otag %}
... (display post here)
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment