From c0f250241b62175e242715ef5ea93b96935635b2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 1 Jan 2009 19:22:47 -0500 Subject: harvest, other language filenames --- lib/sisu/v0/harvest_authors.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v0/harvest_authors.rb') diff --git a/lib/sisu/v0/harvest_authors.rb b/lib/sisu/v0/harvest_authors.rb index 0cecd9d7..151696c3 100644 --- a/lib/sisu/v0/harvest_authors.rb +++ b/lib/sisu/v0/harvest_authors.rb @@ -136,8 +136,15 @@ module HARVEST_authors if @title and @author_format #and @orig_pub (publication details) creator=FORMAT::Author.new(@author_format.strip).author_details @authors,@authorship=creator[:authors],creator[:authorship] - file=filename.sub(/\.ss[mt]$/,'') - idx_array <<= { :filename => filename, :file => file, :orig_pub => @orig_pub, :date => @date, :title => @fulltitle, :author => creator } + file=if filename=~/~[a-z]{2,3}\.ss[mt]$/ + lang='.' + /~([a-z]{2,3})\.ss[mt]$/.match(filename)[1] + filename.sub(/~[a-z]{2,3}\.ss[mt]$/,'') + else + lang='' + filename.sub(/\.ss[mt]$/,'') + end + page="sisu_manifest#{lang}.html" + idx_array <<= { :filename => filename, :file => file, :orig_pub => @orig_pub, :date => @date, :title => @fulltitle, :author => creator, :page => page } else #p "missing author field: #@filename title: #@title; author: #@author_format; idx: #@orig_pub" end @@ -161,7 +168,7 @@ module HARVEST_authors if @@the_idx_authors[author].class==NilClass @@the_idx_authors[author]={:md => []} end - @@the_idx_authors[author][:md] << { :filename => idx[:filename], :file => idx[:file], :author => idx[:author], :title => idx[:title], :date => idx[:date] } + @@the_idx_authors[author][:md] << { :filename => idx[:filename], :file => idx[:file], :author => idx[:author], :title => idx[:title], :date => idx[:date], :page => idx[:page] } end end @the_idx=@@the_idx_authors @@ -172,7 +179,6 @@ module HARVEST_authors @opt,@the_idx=opt,the_idx @env=SiSU_Env::Info_env.new @rc=Get_init.instance.yamlrc - @page='sisu_manifest.html' @alph=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] @letter=@alph.shift @vz=SiSU_Env::Get_init.instance.skin @@ -295,9 +301,9 @@ WOK @output[:html] << x works=[] a[1][:md].each do |x| - work=[ "#{x[:date]} #{x[:title]}", %{

#{x[:date]} #{x[:title]}, #{x[:author][:authors_s]}

} ] + work=[ "#{x[:date]} #{x[:title]}", %{

#{x[:date]} #{x[:title]}, #{x[:author][:authors_s]}

} ] works<<=if @output[:html_mnt].class == File - work.concat([%{

[src]  #{x[:date]} #{x[:title]}, #{x[:author][:authors_s]} -- [#{x[:file]}.sst]

}]) + work.concat([%{

[src]  #{x[:date]} #{x[:title]}, #{x[:author][:authors_s]} -- [#{x[:file]}.sst]

}]) else work end end -- cgit v1.2.3