From 8262dff883492d59aadf21458da623be9e76296a Mon Sep 17 00:00:00 2001 From: Vedanth Padmaraman Date: Fri, 4 Jul 2025 00:26:50 +0530 Subject: [PATCH] Photoswipe: Allow image listing in album_list.html This commit introduces 2 main changes to the Photoswipe theme: 1. The media listing logic from "album.html" is separated and put in a new template, "album_items.html". Similarly, the supporting JavaScript content for initializing Photoswipe is split off into "ps_head.html". 2. The two new templates, "album_items.html" and "ps_head.html", are included in "album_list.html" in addition to "album.html". --- .../themes/photoswipe/templates/album.html | 86 +------------------ .../photoswipe/templates/album_items.html | 39 +++++++++ .../photoswipe/templates/album_list.html | 7 ++ .../themes/photoswipe/templates/ps_head.html | 51 +++++++++++ 4 files changed, 99 insertions(+), 84 deletions(-) create mode 100644 src/sigal/themes/photoswipe/templates/album_items.html create mode 100644 src/sigal/themes/photoswipe/templates/ps_head.html diff --git a/src/sigal/themes/photoswipe/templates/album.html b/src/sigal/themes/photoswipe/templates/album.html index 5de0b3d..4576542 100644 --- a/src/sigal/themes/photoswipe/templates/album.html +++ b/src/sigal/themes/photoswipe/templates/album.html @@ -1,92 +1,10 @@ {% from 'description.html' import img_description %} {% extends "base.html" %} -{% block extra_head %} - - -{% endblock extra_head %} +{% include "ps_head.html" %} {% block content %} - {% include 'download_zip.html' %} - {% include 'map.html' %} - + {% include "album_items.html" %} {% endblock %} {% block extra_footer %} diff --git a/src/sigal/themes/photoswipe/templates/album_items.html b/src/sigal/themes/photoswipe/templates/album_items.html new file mode 100644 index 0000000..31064e3 --- /dev/null +++ b/src/sigal/themes/photoswipe/templates/album_items.html @@ -0,0 +1,39 @@ +{% from 'description.html' import img_description %} + + {% include 'download_zip.html' %} + {% include 'map.html' %} + diff --git a/src/sigal/themes/photoswipe/templates/album_list.html b/src/sigal/themes/photoswipe/templates/album_list.html index ddc6e53..7e7786c 100644 --- a/src/sigal/themes/photoswipe/templates/album_list.html +++ b/src/sigal/themes/photoswipe/templates/album_list.html @@ -1,4 +1,9 @@ {% extends "base.html" %} + +{% if album.medias %} + {% include "ps_head.html" %} +{% endif %} + {% block content %}
{% for alb in album.albums %} @@ -10,4 +15,6 @@
{% endfor %} + + {% include "album_items.html" %} {% endblock %} diff --git a/src/sigal/themes/photoswipe/templates/ps_head.html b/src/sigal/themes/photoswipe/templates/ps_head.html new file mode 100644 index 0000000..77b1e0c --- /dev/null +++ b/src/sigal/themes/photoswipe/templates/ps_head.html @@ -0,0 +1,51 @@ +{% block extra_head %} + + + +{% endblock extra_head %}