Permalink
Browse files

[Theme] Hide tags that only include one post

Note: if the </ul> is indented, Liquid render HTML improperly
  • Loading branch information...
imrickysu committed Feb 22, 2015
1 parent 7d8809c commit ee7f2639c9bf18c531f32b118780b0520bfa0e2b
Showing with 13 additions and 8 deletions.
  1. +13 −8 tags.md
21 tags.md
@@ -7,17 +7,22 @@ permalink: /tags/
<ul class="tags-box">
{% if site.posts != empty %}
{% for tag in site.tags %}
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}">{{ tag[0] }}<span class="size"> {{ tag[1].size }}</span></a>
{% if tag[1].size > 1%}
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}">{{ tag[0] }}<span class="size"> {{ tag[1].size }}</span></a>
{% endif %}

{% endfor %}
</ul>
</ul>

<ul class="tags-box">
<ul class="tags-box">
{% for tag in site.tags %}
<li id="{{ tag[0] }}">{{ tag[0] }}</li>
{% for post in tag[1] %}
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time> &raquo;
<a href="{{ site.baseurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a><br />
{% endfor %}
{% if tag[1].size > 1%}
<li id="{{ tag[0] }}">{{ tag[0] }}</li>
{% for post in tag[1] %}
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time> &raquo;
<a href="{{ site.baseurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a><br />
{% endfor %}
{% endif %}
{% endfor %}
{% else %}
<span>No posts</span>

0 comments on commit ee7f263

Please sign in to comment.