diff options
| author | Botond Hende <nettingman@gmail.com> | 2026-01-14 01:49:34 +0100 |
|---|---|---|
| committer | Botond Hende <nettingman@gmail.com> | 2026-01-14 01:49:34 +0100 |
| commit | 37df42aa74d54ab682cd5cdaf0cd967fa49a8f95 (patch) | |
| tree | d06b4ba8362adc8eca6b5f01ef7b526e993d818c /modules/comic_generate.py | |
| parent | 758f4ed549ca6c01dd621f943e7b4eee3700eb33 (diff) | |
fixed links at the both ends of the comic issues
Diffstat (limited to 'modules/comic_generate.py')
| -rw-r--r-- | modules/comic_generate.py | 8 |
1 files changed, 5 insertions, 3 deletions
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) |
