From 64c955727529d9dd4275c9508008c5808014afc4 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Fri, 8 May 2026 17:43:38 +0200 Subject: multiple sites on root domain --- modules/main_generate.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/main_generate.py') 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 -- cgit v1.3