From 37df42aa74d54ab682cd5cdaf0cd967fa49a8f95 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Wed, 14 Jan 2026 01:49:34 +0100 Subject: fixed links at the both ends of the comic issues --- modules/comic_generate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/comic_generate.py b/modules/comic_generate.py index 1b895e0..36a0f86 100644 --- a/modules/comic_generate.py +++ b/modules/comic_generate.py @@ -82,8 +82,8 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool): ctx = { "issue": issue, "url": issue.get_link(), - "previous": "/#" if idx == 0 else f"/issues/{str(idx)}", - "next": "/#" if idx == last_issue_idx else f"/issues/{str(idx + 2)}" + "previous": "/issues/1/#" if idx == 0 else f"/issues/{str(idx)}", + "next": f"/issues/{str(idx + 1)}/#" if idx == last_issue_idx else f"/issues/{str(idx + 2)}" } with open(os.path.join(output_dir, "index.html"), "w") as f: @@ -92,7 +92,9 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool): shutil.copyfile(os.path.join(issue.path, IMAGE_FILE_NAME), os.path.join(output_dir, IMAGE_FILE_NAME)) if idx == last_issue_idx: - shutil.copy(os.path.join(output_dir, "index.html"), os.path.join(output_root_path, "index.html")) + ctx.update(next="/#") + with open(os.path.join(output_root_path, "index.html"), "w") as f: + f.write(issue_template.render(ctx)) shutil.copytree(Config.COMIC_ASSETS_SOURCE_DIR, output_root_path + Config.ASSETS_IMPORT_PATH) -- cgit v1.2.3-70-g09d2