Skip to content

Instantly share code, notes, and snippets.

@lrtfm
Created May 15, 2012 16:36
Show Gist options
  • Save lrtfm/2703122 to your computer and use it in GitHub Desktop.
Save lrtfm/2703122 to your computer and use it in GitHub Desktop.
jekyll tag index
---
layout: def
title: TAGS
---
<div id="tagindex">
{% capture array %}{% for tag in site.tags %}{{ tag | first }}
{% endfor %}{% endcapture %}
{% for tag in array %}
<div id={{tag}} >
<h1>{{tag}}</h1>
<ul>
{% for post in site.posts %}
{% for ntag in post.tags %}
{% if tag contains ntag %}
<!-- 标签下文件索引显示方式,添加在这里 -->
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment