aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-03-25 22:48:33 -0400
committerRalph Amissah <ralph@amissah.com>2013-03-25 22:55:28 -0400
commite6855a21ab8213fa87d7940a59773c8ff725fe8b (patch)
treee2fe3a8d5c54d804309c9f60bbb8099647007e6b /lib/sisu/v4
parentv4: manifest & harvest, links to default site home page index.html (diff)
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)
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)