Sort archive pages by date (descending)

This commit is contained in:
Stefan Schlott 2013-08-26 09:26:01 +02:00
parent a24b9f1f99
commit 35bcc0d250

View file

@ -9,6 +9,7 @@ def generate_yearly_archive(articles, date_attribute, basepath, title, templaten
yearlist = yearmap.keys.sort
yearlist.each_index { |i|
year = yearlist[i]
yearmap[year].sort! { |a,b| b[date_attribute] <=> a[date_attribute] }
linkprev = if (i>0)
", :linkprev => OpenStruct.new(:title => '#{yearlist[i-1]}', :link => '#{basepath}/#{yearlist[i-1]}/')"
else