diff options
Diffstat (limited to 'template.py')
-rwxr-xr-x | template.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/template.py b/template.py index 90e10ffc..91ee0a8e 100755 --- a/template.py +++ b/template.py | |||
@@ -34,7 +34,7 @@ if (os.getenv("DEBUG")): | |||
34 | 34 | ||
35 | langs_full = {"en": "English", "fr": "Français", "it": "Italiano", "es": "Español", "de": "Deutsch"} | 35 | langs_full = {"en": "English", "fr": "Français", "it": "Italiano", "es": "Español", "de": "Deutsch"} |
36 | 36 | ||
37 | for in_file in glob.glob("*.j2"): | 37 | for in_file in glob.glob("template/*.j2"): |
38 | name, ext = re.match(r"(.*)\.([^.]+)$", in_file.rstrip(".j2")).groups() | 38 | name, ext = re.match(r"(.*)\.([^.]+)$", in_file.rstrip(".j2")).groups() |
39 | tmpl = env.get_template(in_file) | 39 | tmpl = env.get_template(in_file) |
40 | 40 | ||
@@ -77,7 +77,7 @@ for in_file in glob.glob("*.j2"): | |||
77 | url_localized=url_localized, | 77 | url_localized=url_localized, |
78 | svg_localized=svg_localized, | 78 | svg_localized=svg_localized, |
79 | filename=name + "." + ext) | 79 | filename=name + "." + ext) |
80 | out_name = "./" + locale + "/" + in_file.rstrip(".j2") | 80 | out_name = "./rendered/" + locale + "/" + in_file.replace('template/', '').rstrip(".j2") |
81 | os.makedirs("./" + locale, exist_ok=True) | 81 | os.makedirs("./rendered/" + locale, exist_ok=True) |
82 | with codecs.open(out_name, "w", encoding='utf-8') as f: | 82 | with codecs.open(out_name, "w", encoding='utf-8') as f: |
83 | f.write(content) | 83 | f.write(content) |