Sort archive pages by date (descending)
This commit is contained in:
parent
a24b9f1f99
commit
35bcc0d250
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue