Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattberther/390040 to your computer and use it in GitHub Desktop.
Save mattberther/390040 to your computer and use it in GitHub Desktop.
<% archives.group_by {|entry| Date.parse(entry.date).year}.map { |year, entries| [year, entries] }.sort { |x,y| y <=> x }.each do |year, entries| %>
<% if entries.length > 0 %>
<h2><%= year %> Entries</h2>
<% for entry in entries %>
<li>
<a href="<%= entry.path %>"><%= entry.title %></a>
</li>
<% end %>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment