summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-12-16 05:38:40 +0000
committerRalph Amissah <ralph@amissah.com>2008-12-16 05:38:40 +0000
commitea4fafffc7da800b846944113fd45ad330decf2b (patch)
treef11f49b1e8379f264b629044a6c069e9ec6cb343
parenti18n, fix related to variable renaming (diff)
downloadsisu-ea4fafffc7da800b846944113fd45ad330decf2b.zip
sisu-ea4fafffc7da800b846944113fd45ad330decf2b.tar.xz
harvest_authors, sort authors works
-rw-r--r--lib/sisu/v0/harvest_authors.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb
index 9678e4f..a9a2be0 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>]&nbsp;&nbsp;#{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>]&nbsp;&nbsp;#{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