From ea4fafffc7da800b846944113fd45ad330decf2b Mon Sep 17 00:00:00 2001 From: Ralph Amissah <ralph@amissah.com> Date: Tue, 16 Dec 2008 00:38:40 -0500 Subject: harvest_authors, sort authors works --- lib/sisu/v0/harvest_authors.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb index 9678e4f7..a9a2be03 100644 --- a/lib/sisu/v0/harvest_authors.rb +++ b/lib/sisu/v0/harvest_authors.rb @@ -293,11 +293,17 @@ WOK @output[:html_mnt] << x end @output[:html] << x + works=[] a[1][:md].each do |x| - if @output[:html_mnt].class == File - @output[:html_mnt] << %{<p class="publication">[<a href="#{x[:file]}.sst">src</a>] #{x[:date]} <a href="file://#{@env.path.output}/#{x[:file]}/#{@page}">#{x[:title]}</a>, #{x[:author][:authors_s]} -- [<a href="#{x[:file]}.sst">#{x[:file]}.sst</a>]</p>} + work=[ "#{x[:date]} #{x[:title]}", %{<p class="publication">#{x[:date]} <a href="../#{x[:file]}/#{@page}">#{x[:title]}</a>, #{x[:author][:authors_s]}</p>} ] + works<<=if @output[:html_mnt].class == File + work.concat([%{<p class="publication">[<a href="#{x[:file]}.sst">src</a>] #{x[:date]} <a href="file://#{@env.path.output}/#{x[:file]}/#{@page}">#{x[:title]}</a>, #{x[:author][:authors_s]} -- [<a href="#{x[:file]}.sst">#{x[:file]}.sst</a>]</p>}]) + else work end - @output[:html] << %{<p class="publication">#{x[:date]} <a href="../#{x[:file]}/#{@page}">#{x[:title]}</a>, #{x[:author][:authors_s]}</p>} + end + works.sort_by {|x| x[0]}.each do |x| + @output[:html] << x[1] + @output[:html_mnt] << x[2] if @output[:html_mnt].class == File end end end -- cgit v1.2.3