Created
May 18, 2014 05:09
-
-
Save Ovilia/5248cd4f9b7f50d9652b to your computer and use it in GitHub Desktop.
Jekyll Tag Searching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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