From 435dd18865ac0137d5ec7aa011555773eefb49c1 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 6 May 2024 18:40:53 +0200 Subject: --group-files: add links to other files --- bin/pyggle | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/pyggle b/bin/pyggle index 74d9d71..1b935e4 100755 --- a/bin/pyggle +++ b/bin/pyggle @@ -571,15 +571,32 @@ def copy_files(base_dir): f.write(main_css) -def write_gallery(file_buf, filename, thumbnails, group=None): - prev_heading = None +def write_gallery( + file_buf, filename, thumbnails, group=None, files=list(), this_file=None +): + + if files: + nav_buf = '" + file_buf += nav_buf + prev_heading = None for i, thumbnail in enumerate(thumbnails): if group and thumbnail.group_key != prev_heading: file_buf += f"

{thumbnail.group_key}

" prev_heading = thumbnail.group_key file_buf += thumbnail.to_html(i, args.with_detail_page) + if files: + file_buf += nav_buf + with open(f"{base_dir}/share/html_end", "r") as f: file_buf += f.read() @@ -799,4 +816,6 @@ if __name__ == "__main__": f"{thumbnail_key}.html", list(filter(lambda t: t.file_key == thumbnail_key, thumbnails)), group=args.group, + files=thumbnail_keys, + this_file=thumbnail_key, ) -- cgit v1.2.3