--- /dev/null
+#!@PYTHON@
+
+## This is web_post.py. This script deals with translations
+## in the "make website" target.
+
+import sys
+import os
+import glob
+
+#indir, outdir = sys.argv[1:]
+
+# FIXME: looks dangerous!
+indir = sys.argv[1]
+outdir=indir
+
+html_files = glob.glob( os.path.join(indir, '*.html') )
+
+
+for file in html_files:
+ file_split = file.split('.')
+ # we want to strip the .html
+ out_filename = os.path.basename(file_split[0])
+ if (len(file_split) == 2):
+ # it's English
+ lang = ''
+ else:
+ # it's a translation
+ lang = file_split[1]
+ out_filename += '.'+lang
+
+# I can't get the previous name to work
+ out_filename = os.path.basename(file)
+
+ # translation links should point to translations
+ lines = open(file).readlines()
+ # ick
+ os.remove(file)
+
+ outfile = open( os.path.join(outdir, out_filename), 'w')
+ for line in lines:
+ # avoid external links
+ if ((line.find("href") > 0) and (line.find("http")==-1)):
+# eventually we want to do this, but I can't get it to work.
+# waiting for help with apache (?)
+# line = line.replace(".html", "."+lang)
+ line = line.replace(".html", "."+lang+".html")
+ outfile.write(line)
+ outfile.close()
+
################################################################
OUT=out-website
-WEB_LANGS=es fr
+WEB_LANGS=es
TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
CREATE_VERSION=python $(script-dir)/create-version-itexi.py
CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py
MASS_LINK=python $(script-dir)/mass-link.py
+WEB_POST=python $(script-dir)/web_post.py
SERVER_FILES=$(top-src-dir)/Documentation/web/server/
mkdir -p $(OUT)/website/ly-examples
cp $(EXAMPLES)/* $(OUT)/website/ly-examples
-website: website-texinfo website-css website-pictures website-examples
+web-post:
+ $(WEB_POST) $(OUT)/website/
+
+website: website-texinfo website-css website-pictures website-examples web-post
cp $(SERVER_FILES)/favicon.ico $(OUT)/website/
cp $(SERVER_FILES)/lilypond.org.htaccess $(OUT)/website/.htaccess
cp $(SERVER_FILES)/robots.txt $(OUT)/website/
+