Permalink
Browse files

output category names like tags

  • Loading branch information...
1 parent c81201f commit d2fb3913a2cf994dc76891dc746815eec3ee0ab4 @yihui committed Mar 25, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 categories/index.md
View
@@ -3,6 +3,12 @@ title: Categories
layout: page
---
+<div id='tag_cloud'>
+{% for cat in site.categories %}
+<a href="#{{ cat[0] }}" title="{{ cat[0] }}" rel="{{ cat[1].size }}">{{ cat[0] }} ({{ cat[1].size }})</a>
+{% endfor %}
+</div>
+
<ul class="listing">
{% for cat in site.categories %}
<li class="listing-seperator" id="{{ cat[0] }}">{{ cat[0] }}</li>
@@ -15,3 +21,14 @@ layout: page
{% endfor %}
</ul>
+<script src="/media/js/jquery.tagcloud.js" type="text/javascript" charset="utf-8"></script>
+<script language="javascript">
+$.fn.tagcloud.defaults = {
+ size: {start: 1, end: 1, unit: 'em'},
+ color: {start: '#f8e0e6', end: '#ff3333'}
+};
+
+$(function () {
+ $('#tag_cloud a').tagcloud();
+});
+</script>

0 comments on commit d2fb391

Please sign in to comment.