summaryrefslogtreecommitdiff
path: root/template.py
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-01-30 20:41:18 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-01-30 21:21:33 +0100
commit6337e02d9dd8c7be92ffa168f67ab0de651664d0 (patch)
tree0d1af548ccc6e7f5105900d510cc353a8b3e3e39 /template.py
parentec065c657e2d2bfdf2ea25eec62cf659cd87d3da (diff)
downloadwww-6337e02d9dd8c7be92ffa168f67ab0de651664d0.tar.gz
www-6337e02d9dd8c7be92ffa168f67ab0de651664d0.tar.bz2
www-6337e02d9dd8c7be92ffa168f67ab0de651664d0.zip
use templates instead of SSI, use relative URLs
Diffstat (limited to 'template.py')
-rwxr-xr-xtemplate.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/template.py b/template.py
index 86516bb6..aab6fddd 100755
--- a/template.py
+++ b/template.py
@@ -23,7 +23,12 @@ env.install_gettext_translations(tr, newstyle=True)
tmpl = env.get_template(in_file)
+def url(x):
+ # TODO: look at the app root environment variable
+ # TODO: check if file exists
+ return x
+
import codecs
f = codecs.open(out_file, "w", "utf-8")
-f.write(tmpl.render())
+f.write(tmpl.render(lang=locale, url=url))
f.close()