diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/main_generate.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/main_generate.py b/modules/main_generate.py index 550c77c..5e058ed 100644 --- a/modules/main_generate.py +++ b/modules/main_generate.py @@ -23,8 +23,11 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool): os.mkdir(output_root_path) - root_template = jinja_env.get_template("main_base.html.j2") - with open(os.path.join(output_root_path, "index.html"), "w") as f: - f.write(root_template.render({"url" : Config.MAIN_ROOT_URL})) + for page in ("index", "neighbors"): + template = jinja_env.get_template(f"main_{page}.html.j2") + html_file_name = f"{page}.html" + with open(os.path.join(output_root_path, html_file_name), "w") as f: + url = (Config.MAIN_ROOT_URL + ("" if page == "index" else "/" + html_file_name)) + f.write(template.render({"url" : url})) shutil.copytree(Config.MAIN_ASSETS_SOURCE_DIR, output_root_path + Config.ASSETS_IMPORT_PATH)
\ No newline at end of file |
