Skip to content

Instantly share code, notes, and snippets.

@mhayes
Created August 23, 2010 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhayes/546374 to your computer and use it in GitHub Desktop.
Save mhayes/546374 to your computer and use it in GitHub Desktop.
<h1><%= @path %></h1>
<ul>
<% if archives.length > 0 %>
<% archives.sort! {|x,y| y[:date] <=> x[:date] } %>
<% archives.collect {|a| a[:date].year }.uniq.each do |year| %>
<h3><%= year %></h3>
<% archives.select {|e| e[:date].year == year }.each do |entry| %>
<li>
<a href="<%= entry.path %>"><%= entry.title %></a>
</li>
<% end %>
<% end %>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment