diff options
| author | Botond Hende <nettingman@gmail.com> | 2025-12-23 15:57:09 +0100 |
|---|---|---|
| committer | Botond Hende <nettingman@gmail.com> | 2025-12-23 15:57:09 +0100 |
| commit | 7308b658153e089456dd1b5ad691ff8db19088cd (patch) | |
| tree | c26e122bff0a621c7622ddaf08c1f899a7267bf2 /modules/comic_generate.py | |
| parent | 71c7de032edca8bfd00871e0f0fe986bbd9e60a5 (diff) | |
comic styling
Diffstat (limited to 'modules/comic_generate.py')
| -rw-r--r-- | modules/comic_generate.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/comic_generate.py b/modules/comic_generate.py index 7c55521..9c88d67 100644 --- a/modules/comic_generate.py +++ b/modules/comic_generate.py @@ -59,6 +59,7 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool): issues = get_issues(Config.ISSUE_SOURCE_DIR, local) issue_template = jinja_env.get_template("issue.html.j2") + last_render = None for issue in issues: output_dir = os.path.join(output_root_path, "issues", issue.index) @@ -69,10 +70,13 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool): "url": f"{Config.COMIC_ROOT_URL}/issues/{issue.index}" } + last_render = issue_template.render(ctx) with open(os.path.join(output_dir, "index.html"), "w") as f: - f.write(issue_template.render(ctx)) + f.write(last_render) shutil.copyfile(os.path.join(issue.path, IMAGE_FILE_NAME), os.path.join(output_dir, IMAGE_FILE_NAME)) - shutil.copytree(Config.COMIC_ASSETS_SOURCE_DIR, output_root_path + Config.ASSETS_IMPORT_PATH) + with open(os.path.join(output_root_path, "index.html"), "w") as f: + f.write(last_render) + shutil.copytree(Config.COMIC_ASSETS_SOURCE_DIR, output_root_path + Config.ASSETS_IMPORT_PATH) |
