Created
December 19, 2011 05:59
-
-
Save waynezhang/1495626 to your computer and use it in GitHub Desktop.
Tag Cloud for Jekyll on Github Pages
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
<div id='tag_cloud'> | |
{% for tag in site.tags %} | |
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}">{{ tag[0] }}</a> | |
{% endfor %} | |
</div> | |
<ul id='tag_list'> | |
{% for tag in site.tags %} | |
<li class='tag_item' id='{{ tag[0] }}'> | |
<span class='tag_name'>{{ tag[0] }}</span> | |
<span> | |
<ul> | |
{% for post in tag[1] %} | |
<li class='tag_post'><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></li> | |
{% endfor %} | |
</ul> | |
</span> | |
</li> | |
{% endfor %} | |
</ul> | |
<script src="/media/js/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script> | |
<script src="/media/js/jquery.tagcloud.js" type="text/javascript" charset="utf-8"></script> | |
<script language="javascript"> | |
$.fn.tagcloud.defaults = { | |
size: {start: 0.9, end: 2, unit: 'em'}, | |
color: {start: '#e77471', end: '#f62817'} | |
}; | |
$(function () { | |
$('#tag_cloud a').tagcloud(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment