lib/ascii_binder/helpers.rb in ascii_binder-0.0.5 vs lib/ascii_binder/helpers.rb in ascii_binder-0.0.6

- old
+ new

@@ -661,11 +661,10 @@ # This method generates the docs and then organizes them the way they will be arranged # for the production websites. def package_docs(package_site) site_map.each do |site,site_config| next if not package_site == '' and not package_site == site - puts "\nBuilding #{site} site." site_config[:distros].each do |distro,branches| branches.each do |branch,branch_config| src_dir = File.join(preview_dir,distro,branch_config["dir"]) tgt_tdir = branch_config["dir"].split('/') tgt_tdir.pop @@ -679,27 +678,30 @@ FileUtils.mkdir_p(tgt_dir) FileUtils.cp_r(src_dir,tgt_dir) end site_dir = File.join(package_dir,site) if File.directory?(site_dir) + puts "\nBuilding #{site} site." + # With this update, site index files will always come from the master branch working_branch_site_index = File.join(source_dir,'index-' + site + '.html') if File.exists?(working_branch_site_index) FileUtils.cp(working_branch_site_index,File.join(package_dir,site,'index.html')) ['_images','_stylesheets'].each do |support_dir| FileUtils.cp_r(File.join(source_dir,support_dir),File.join(package_dir,site,support_dir)) end else FileUtils.cp(File.join(preview_dir,distro,'index.html'),File.join(package_dir,site,'index.html')) end - end - # Now build a sitemap - site_dir_path = Pathname.new(site_dir) - SitemapGenerator::Sitemap.default_host = site_config[:url] - SitemapGenerator::Sitemap.create( :compress => false, :filename => File.join(site_dir,'sitemap') ) do - file_list = Find.find(site_dir).select{ |path| not path.nil? and path =~ /.*\.html$/ }.map{ |path| '/' + Pathname.new(path).relative_path_from(site_dir_path).to_s } - file_list.each do |file| - add(file, :changefreq => 'daily') + + # Now build a sitemap + site_dir_path = Pathname.new(site_dir) + SitemapGenerator::Sitemap.default_host = site_config[:url] + SitemapGenerator::Sitemap.create( :compress => false, :filename => File.join(site_dir,'sitemap') ) do + file_list = Find.find(site_dir).select{ |path| not path.nil? and path =~ /.*\.html$/ }.map{ |path| '/' + Pathname.new(path).relative_path_from(site_dir_path).to_s } + file_list.each do |file| + add(file, :changefreq => 'daily') + end end end end end end