diff options
-rw-r--r-- | data/doc/sisu/CHANGELOG_v4 | 4 | ||||
-rw-r--r-- | lib/sisu/v4/sysenv.rb | 22 |
2 files changed, 19 insertions, 7 deletions
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 8ac9e79b..da105e62 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.17.orig.tar.xz * v4: manifest & harvest, links to default site home page index.html +* 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) + %% 4.0.16.orig.tar.xz (2013-03-18:11/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.16 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.16-1 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) |