Skip to content
This repository was archived by the owner on Nov 24, 2019. It is now read-only.

Commit 512fd88

Browse files
committed
Add tag cloud to tag index page
1 parent edad8f3 commit 512fd88

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

assets/css/main.css

+4
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ span+.entry-title{margin-top:0;}
603603
.post-list li:after{clear:both;}
604604
.post-list a>span{float:right;}
605605
.post-list .entry-date{font-size:14px;font-size:0.875rem;text-transform:uppercase;}
606+
.tag-box{list-style:none;margin:0;padding:4px 0;overflow:hidden;*zoom:1;}.tag-box:before,.tag-box:after{display:table;content:"";line-height:0;}
607+
.tag-box:after{clear:both;}
608+
.tag-box.inline li{float:left;font-size:14px;font-size:0.875rem;line-height:2.5;}
609+
.tag-box a{padding:4px 6px;margin:2px;background-color:#e6e6e6;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;text-decoration:none;}.tag-box a span{vertical-align:super;font-size:10px;font-size:0.625rem;}
606610
.footer-wrapper{*zoom:1;margin:2em auto;text-align:center;font-family:'volkorn',serif;font-size:14px;font-size:0.875rem;font-style:italic;color:#666666;}.footer-wrapper:before,.footer-wrapper:after{display:table;content:"";line-height:0;}
607611
.footer-wrapper:after{clear:both;}
608612
.footer-wrapper a{color:#666666;}

assets/less/page.less

+24
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,30 @@ span + .entry-title {
323323
text-transform: uppercase;
324324
}
325325
}
326+
// Tag index
327+
.tag-box {
328+
list-style: none;
329+
margin: 0;
330+
padding: 4px 0;
331+
overflow: hidden;
332+
.clearfix();
333+
&.inline li {
334+
float: left;
335+
.font-rem(14);
336+
line-height: 2.5;
337+
}
338+
a {
339+
padding: 4px 6px;
340+
margin: 2px;
341+
background-color: lighten(@black, 90);
342+
.rounded(4px);
343+
text-decoration: none;
344+
span {
345+
vertical-align: super;
346+
.font-rem(10);
347+
}
348+
}
349+
}
326350

327351
// Footer
328352
// --------------------------------------------------

tags.html

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
description: "An archive of posts sorted by tag."
55
---
66

7+
<ul class="tag-box inline">
8+
{% assign tags_list = site.tags %}
9+
{% if tags_list.first[0] == null %}
10+
{% for tag in tags_list %}
11+
<li><a href="#{{ tag }}">{{ tag }} <span>{{ site.tags[tag].size }}</span></a></li>
12+
{% endfor %}
13+
{% else %}
14+
{% for tag in tags_list %}
15+
<li><a href="#{{ tag[0] }}">{{ tag[0] }} <span>{{ tag[1].size }}</span></a></li>
16+
{% endfor %}
17+
{% endif %}
18+
{% assign tags_list = nil %}
19+
</ul>
20+
721
{% for tag in site.tags %}
822
<h2 id="{{ tag[0] }}">{{ tag[0] }}</h2>
923
<ul class="post-list">

0 commit comments

Comments
 (0)