aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4')
-rw-r--r--lib/sisu/v4/sysenv.rb22
1 files changed, 15 insertions, 7 deletions
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)