aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-04-19 21:39:06 -0400
committerRalph Amissah <ralph@amissah.com>2011-04-19 21:39:06 -0400
commitcc7bc6de70ca4dcfeee781803bc6a43dc7c273ea (patch)
tree02fb16f0a4502293d09d01ae30b58942c6ad726e /lib/sisu/v3/sysenv.rb
parentv3: param, md remove md.cmd and md.mod shortcut methods, use use md.opt (diff)
v3: harvest, sysenv, place with document manifests, variable directory path
* sysenv, variable directory path fixing (language, filetype, filname), making the stub for at least manifest and html available early for processing that do not or should not need to process individual markup files completely, such as the cgi search form and harvest * harvest * place with document manifests * variable directory path fixing (language, filetype, filname)
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb30
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index e3aee003..6f69296a 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -902,6 +902,23 @@ module SiSU_Env
@stub_src= @stub_pwd + '/src'
@stub_pod= @stub_pwd + '/pod'
@stub_md= @stub_pwd + '/sisu_site_metadata'
+ pt=Pathname.new(Dir.pwd)
+ stub=if output_dir_structure.by_language_code?
+ stub=if Dir.pwd =~/.+?\/([^\/]+)(?:\/(en|fr|es)$)/
+ lng=pt.split[-1].to_s
+ lng_part='/' + lng
+ base=pt.split[0].split[-1].to_s
+ else
+ lng_part='/' + 'en' #fix default language
+ base=pt.split[-1].to_s
+ end
+ base + lng_part
+ elsif output_dir_structure.by_filetype?
+ pt.split[-1].to_s
+ elsif output_dir_structure.by_filename?
+ ''
+ end
+ @stub_set_manifest=stub + '/manifest'
end
def user
@sys.user
@@ -968,8 +985,8 @@ module SiSU_Env
def stub_pwd #200412
@stub_pwd
end
- def stub_md_harvest
- @stub_md
+ def stub_md_harvest #watch
+ @stub_set_manifest
end
def stub_src
@stub_src
@@ -1387,6 +1404,9 @@ WOK
def stub_manifest
@stub_manifest
end
+ def stub_set_manifest
+ @stub_set_manifest
+ end
def stub_src
@stub_src
end
@@ -1394,7 +1414,7 @@ WOK
@stub_pod
end
def stub_md_harvest
- @stub_md
+ @stub_set_manifest
end
def etc
defaults[:sisu_etc] #live/dynamic
@@ -2408,7 +2428,7 @@ WOK
? "#{@env.path.output}/pod" \
: @env.path.output_pod)
@source_path_harvest=(@fnb && !(@fnb.empty?) \
- ? "#{@env.path.output}/sisu_site_metadata" \
+ ? "#{@env.path.output}/manifest" \
: @env.path.output_harvest)
@local_sisu_source=(@filetypes =~/\S/) \
? "#{@source_path}/#{@filetypes}" \
@@ -3425,7 +3445,7 @@ WOK
@env.processing_path.git + '/' + @md.fnb + '/' + ft
end
def md_harvest
- "#{output_path.base}/sisu_site_metadata"
+ manifest
end
def txt
ft='txt'