diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-12-19 22:54:57 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-12-19 22:54:57 -0500 |
commit | 1ae0b08d1ad384f85e72fa40835ee68992aee150 (patch) | |
tree | 2f4866afef62016a34444d381a59ee44ed926634 /lib | |
parent | debian/changelog (3.1.8-1) (diff) | |
parent | v3: html, seg output, index.html fixes (diff) |
Merge commit 'sisu_3.1.9' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v3/html.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v3/options.rb | 7 | ||||
-rw-r--r-- | lib/sisu/v3/sysenv.rb | 14 |
3 files changed, 15 insertions, 16 deletions
diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 3f867215..145ceb40 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -634,7 +634,6 @@ WOK def segtoc begin @filename_html_segtoc=@file.write_file.html_segtoc - @filename_html_index=@file.write_file.html_seg_index @data.each do |para| para.strip! para.gsub!(/<!.+?!>/,'') @@ -642,19 +641,16 @@ WOK para.gsub!(Xx[:html_relative1],@file.path_rel_links.html_seg_1) unless para =~/\A\s*\Z/ @filename_html_segtoc.puts para,"\n" - @filename_html_index.puts para,"\n" end end rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure @filename_html_segtoc.close - @filename_html_index.close - ## only works properly for directory_structure_by language, fix - unless FileTest.file?("#{@file.output_path.html.dir}/index.html") + unless FileTest.file?("#{@file.output_path.html_seg.dir}/#{@md.file.base_filename.html_seg_index}") pwd_set=Dir.pwd idx_lnk=@file.base_filename.html_segtoc - mlnk='index.html' - Dir.chdir(@file.output_path.html.dir) + mlnk=@file.base_filename.html_seg_index + Dir.chdir(@file.output_path.html_seg.dir) FileUtils::rm_f(mlnk) FileUtils::ln_s(idx_lnk, mlnk) Dir.chdir(pwd_set) diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index ffd0da0f..b9d54123 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -131,7 +131,12 @@ module SiSU_commandline if find_flag \ && y !~ /^-/ \ && y =~ /\S+/ - f << y + if y !~/\// + f << y + else + find_flag=false + puts %{sub-directories "#{y}" cannot be provided for --find or --glob at this time} + end end end r=Px[:lng_lst].join('|') diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 98a58f72..436e1d7f 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -3740,7 +3740,7 @@ WOK def html_seg_index ft='.html' if @env.output_dir_structure.by_language_code? - 'toc' + ft + 'index' + ft else 'index' + @md.lang_code_insert + ft end @@ -5155,18 +5155,16 @@ WOK @vz_home=SiSU_Viz::Home.new end def homepage - homepage_path=nil + home_pages_manually_created=nil @env.sys.rc_path.each do |v| - if FileTest.file?("#{v}/home/index.html") - homepage_path="#{v}/home/index.html" + home_pages_manually_created=Dir.glob("#{v}/home/*.html") + if home_pages_manually_created.length > 0 break end end FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}") - if homepage_path \ - and FileTest.file?(homepage_path) - FileUtils::cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html") - FileUtils::cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html") + if home_pages_manually_created + FileUtils.cp(home_pages_manually_created,"#{@env.path.webserv}/#{@env.path.stub_pwd}") else doc_skin=nil sk_doc='doc/skin_sisu.rb' |