From b2a1d9c6f06750cd0b2ccf7d069fe98381c2afb8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 20 Mar 2013 20:44:22 -0400 Subject: v4: manifest & harvest, links to default site home page index.html --- lib/sisu/v4/harvest_authors.rb | 17 +++++++++++++++-- lib/sisu/v4/harvest_topics.rb | 17 +++++++++++++++-- lib/sisu/v4/manifest.rb | 14 +++++++++++--- 3 files changed, 41 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/harvest_authors.rb b/lib/sisu/v4/harvest_authors.rb index 671b93ab..e360e3a3 100644 --- a/lib/sisu/v4/harvest_authors.rb +++ b/lib/sisu/v4/harvest_authors.rb @@ -252,6 +252,19 @@ module SiSU_HarvestAuthors harvest_languages += %{#{l}   } end sv=SiSU_Env::InfoVersion.instance.get_version + if @env.output_dir_structure.by? == :language + home_pth='../..' + output_structure_by='(output organised by language & filetype)' + elsif @env.output_dir_structure.by? == :filetype + home_pth='..' + output_structure_by='(output organised by filetype)' + elsif @env.output_dir_structure.by? == :filename + home_pth='.' + output_structure_by='(output organised by filename)' + else + home_pth='.' + output_structure_by='(output organised by ?)' + end < @@ -270,8 +283,8 @@ module SiSU_HarvestAuthors -

SiSU Metadata Harvest - Authors

-

[ HOME ] also see SiSU Metadata Harvest - Topics

+

SiSU Metadata Harvest - Authors #{output_structure_by}

+

[ HOME ] also see SiSU Metadata Harvest - Topics

#{@env.widget_static.search_form}


#{harvest_languages}

diff --git a/lib/sisu/v4/harvest_topics.rb b/lib/sisu/v4/harvest_topics.rb index fda71e7c..bce96ced 100644 --- a/lib/sisu/v4/harvest_topics.rb +++ b/lib/sisu/v4/harvest_topics.rb @@ -610,6 +610,19 @@ module SiSU_HarvestTopics harvest_languages += %{#{l}   } end sv=SiSU_Env::InfoVersion.instance.get_version + if @env.output_dir_structure.by? == :language + home_pth='../..' + output_structure_by='(output organised by language & filetype)' + elsif @env.output_dir_structure.by? == :filetype + home_pth='..' + output_structure_by='(output organised by filetype)' + elsif @env.output_dir_structure.by? == :filename + home_pth='.' + output_structure_by='(output organised by filename)' + else + home_pth='.' + output_structure_by='(output organised by ?)' + end < @@ -628,8 +641,8 @@ module SiSU_HarvestTopics -

SiSU Metadata Harvest - Topics

-

[ HOME ] also see SiSU Metadata Harvest - Authors

+

SiSU Metadata Harvest - Topics #{output_structure_by}

+

[ HOME ] also see SiSU Metadata Harvest - Authors

#{@env.widget_static.search_form}


#{harvest_languages}

diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb index 1f5724c5..403271b5 100644 --- a/lib/sisu/v4/manifest.rb +++ b/lib/sisu/v4/manifest.rb @@ -833,14 +833,22 @@ WOK elsif @f.output_dir_structure.by_language_code? \ or @f.output_dir_structure.by_filetype? pth_local=@f.output_path.manifest.dir - pth_rel='./' + pth_rel='.' else pth_local=@f.output_path.base.dir - pth_rel='../' + pth_rel='..' + end + pth_rel_home=if @env.output_dir_structure.by? == :language + '../..' + elsif @env.output_dir_structure.by? == :filetype + '..' + elsif @env.output_dir_structure.by? == :filename + '..' + else '..' end harvest=(FileTest.file?("#{pth_local}/authors#{@fn_lng}.html") \ && FileTest.file?("#{pth_local}/topics#{@fn_lng}.html")) \ - ? %{

other document manifests: [authors] [topics]

} + ? %{

.: other document manifests: [authors] [topics]

} : '' manifest_title=%{

#{@translate.manifest_description}

#{harvest}} @manifest[:html] <<< Date: Mon, 25 Mar 2013 22:48:33 -0400 Subject: v4: sysenv, copy or create homepages, one of the actions taken on --config * provide info as to where manually created homepages may be stored * do not make default sisu homepage (previously did) --- lib/sisu/v4/sysenv.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb index 92ba76b5..6ed94d5d 100644 --- a/lib/sisu/v4/sysenv.rb +++ b/lib/sisu/v4/sysenv.rb @@ -5904,14 +5904,11 @@ WOK @vz=SiSU_Viz::Defaults.new @vz_home=SiSU_Viz::Home.new end - def homepage - home_pages_manually_created=Dir.glob("#{@env.path.rc}/home/*.html") - FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}") - if home_pages_manually_created.length > 0 - home_pages_manually_created.each do |homepage| - FileUtils.cp(homepage,"#{@env.path.webserv}/#{@env.path.stub_pwd}") - end + def create_default_sisu_homepage(action=:none) + if action==:none + puts %{ place your homepages in directory:\n "#{@env.path.rc}/home/*.html"\n (no action taken)} else + puts %{ place your homepages in directory:\n "#{@env.path.rc}/home/*.html"\n (in order to replace default sisu homepage)} filename_homepage="#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html" filename_home_toc="#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html" file_homepage=File.new(filename_homepage,'w') @@ -5922,6 +5919,17 @@ WOK file_home_toc.close end end + def homepage + home_pages_manually_created=Dir.glob("#{@env.path.rc}/home/*.html") + FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}") + if home_pages_manually_created.length > 0 + home_pages_manually_created.each do |homepage| + FileUtils.cp(homepage,"#{@env.path.webserv}/#{@env.path.stub_pwd}") + end + else + create_default_sisu_homepage(:none) + end + end def cp_images(src_path,dest_path) if FileTest.directory?(src_path) FileUtils::cd(src_path) -- cgit v1.2.3 From 745ce4eee3dd728d1ceac19a7d2af1e67329f2d4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 25 Mar 2013 22:53:58 -0400 Subject: v4: param, guard against situation where no document creator/author given --- lib/sisu/v4/param.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v4/param.rb b/lib/sisu/v4/param.rb index 360625e4..035697c9 100644 --- a/lib/sisu/v4/param.rb +++ b/lib/sisu/v4/param.rb @@ -1154,7 +1154,8 @@ module SiSU_Param tf="@title: #{tf}" @title=SiSU_Param::Parameters::Md.new(tf.strip,@opt,@env).title end - creator=(defined? @creator.author \ + creator=(@creator.is_a?(SiSU_Param::Parameters::Md) \ + && defined? @creator.author \ && @creator.author.is_a?(String)) \ ? " #{@creator.author}" : '' -- cgit v1.2.3 From 9729a8c4a1c6402eb5f6c5fc5d47bcfc966ce385 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 25 Mar 2013 22:58:39 -0400 Subject: v4: hub, non-verbose terminal info reduced, minor --- lib/sisu/v4/hub.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb index 6577f1fa..70a9fc9a 100644 --- a/lib/sisu/v4/hub.rb +++ b/lib/sisu/v4/hub.rb @@ -694,7 +694,7 @@ module SiSU if action_on_file_ == :true \ and @opt.files.length > 0 do_loops - @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil unless @opt.act[:quiet][:set] ==:on + @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil if @opt.cmd =~/[vVM]/ @tell.call.print_brown if @opt.cmd =~/[uUvVM]/ unless @opt.files.join.empty? if defined? @@env.processing_path.processing \ and @@env.user \ -- cgit v1.2.3