summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-18 21:37:33 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-18 21:37:33 +0200
commita2423adab4de94ad5faf1516bcc24b6633bb91e6 (patch)
tree8086e109a1826daa24123f7a0230e3f2b8599258 /bin
parent0dd6c2df5037c22a67f646944a69b77c6fe0ba69 (diff)
Switch to glightbox
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pyggle33
1 files changed, 6 insertions, 27 deletions
diff --git a/bin/pyggle b/bin/pyggle
index 39e68e5..d5b2588 100755
--- a/bin/pyggle
+++ b/bin/pyggle
@@ -134,20 +134,8 @@ def copy_files(base_dir):
imgwidth = f"{conf_size}px"
imgheight = f"{conf_size}px"
- css_files = ("jquery.fancybox.css",)
- css_files += (
- "blank.gif",
- "fancybox_loading@2x.gif",
- "fancybox_loading.gif",
- "fancybox_overlay.png",
- "fancybox_sprite@2x.png",
- "fancybox_sprite.png",
- )
- js_files = (
- "jquery-1.10.2.min.js",
- "jquery.fancybox.pack.js",
- "jquery.mousewheel-3.0.6.pack.js",
- )
+ css_files = ["glightbox.min.css"]
+ js_files = ["glightbox.min.js"]
for css_file in css_files:
shutil.copy(f"{base_dir}/css/{css_file}", f".data/css/{css_file}")
@@ -168,20 +156,11 @@ def copy_files(base_dir):
def create_thumbnail_html(filename, title):
- conf_size = 250
- conf_spacing = 1.1
-
- div_width = conf_size * conf_spacing
- div_height = div_width + 10
-
buf = """<div class="image-container">\n"""
-
- buf += f"""\t<a class="fancybox" href="{filename}" title="{title}" data-fancybox-group="gallery">\n"""
- buf += f"""\t\t<img src=".thumbnails/{filename}" alt="{filename}" /></a>\n"""
-
- buf += f"""\t<br/>\n\t<a style="text-decoration: none;" href="{filename}">{filename}</a>\n"""
-
- buf += "</div>\n"
+ buf += f"""<a href="{filename}" class="glightbox" data-gallery="gallery1" data-description="{title}">"""
+ buf += f"""<img src=".thumbnails/{filename}" alt="{filename}" />"""
+ buf += "</a>"
+ buf += "</div>"
return buf