<div id="cat-nav">
  <h2>Categories</h2>
  <ul>
    <% @site.categories(false).each do |cat| %>
      <li><%= cat.link true %></li>
      <ul>
        <% items = @site.items_by_date(cat)
           size  = items.size
           num   = 20 %>
        <% items.slice!(0, num/2).each do |i| %>
          <%= render 'list-item', :item => i, :episteme => false %>
        <% end %>
        <% if size > num %>
          <li>...<%= size - num %> more...</li>
        <% end %>
        <% items.reverse.slice(0, num/2).reverse.each do |i| %>
          <%= render 'list-item', :item => i, :episteme => false %>
        <% end %>
      </ul>
    <% end %>
  </ul>

  <h2>All Posts</h2>
  <ul>
    <li><a href='/categories/'>All Posts By Category</a></li>
    <li><a href='/date/'>All Posts By Date</a></li>
    <li><a href='/rss.xml'>RSS feed</a></li>
    <li><a href='http://<%= @site.disqus_site %>.disqus.com/latest.rss'>RSS feed (comments)</a></li>
  </ul>
</div>
