Hi,
the web gallery export in Darktable is based on an ancient and outdated version of an image gallery software called PhotoSwipe. So it is basically an unmaintained copy of another project inside darktable.
There is also a GitHub issue if you are interested in the details.
https://github.com/darktable-org/darktable/issues/16205
In the discussion of this issue I made a proposal to replace the embedded PhotoSwipe copy by a new static gallery with similar functions as the old one. @wpferguson suggested to remove the old PhotoSwipe module and replace it by a Lua script.
So here is my first shot. To test it, unpack the attached ZIP archive and run ./install.sh (no root permissions required) in a terminal. Finally, you need to run (or restart) darktable and enable the module in the Lua script manager (bottom left corner in the light table). If you don’t have the Lua script manager enabled yet, follow the instructions at https://docs.darktable.org/lua/stable/lua.scripts.manual/installation/
Now you can select select some images and set the storage format to “website gallery (new)” in the export module. You can enter a title that will be shown in the thumbnail view and choose a destination directory. After export, copy the destination directory to a web server and view it in a browser, or just open the index.html in the destination directory.
I would be glad if you could try this out and report back. Furthermore, it would be nice if people with experience in web UI design and programming could look at the code and send patches or comments with improvements. @wpferguson also made a similar (more minimal) approach, where I’ll use some code from. My plan is to get this into a darktable release so the old PhotoSwipe variant can be removed.
The UI shows a thumbnail gallery when the page is loaded, and a modal view when the user clicks or taps on a thumbnail. Navigation in the the modal view is possible using the buttons in the top bar, keyboard (left/right/escape keys), horizontal scrolling and touch gestures (swipe left/right).
Some technical details: my gallery consists of a storage module written in Lua, some static HTML, CSS and a bit of Javascript (~150 lines, compared to 4500 lines in the PhotoSwipe variant). The Lua script generates a JSON file with a list of images and required metadata. This JSON file is loaded by the above Javascript file. It is the only dynamic part of the gallery (except for the actual image files).
Image preloading in the modal view to speed up switching to the previous/next image is not implemented yet, as well as the zoom function which is present in the PhotoSwipe variant.
In the long term, several UI themes could be provided as .css files. The user
could choose one in the storage settings to give each gallery an individual look. I’ll need to rework the CSS structure before this, though.
[edit: outdated attachment removed, please use the newer version in the replies]