ev15 site generator
A small static photo gallery generator in python. Built for my small photo site, ev-15.com. Much of the setup here is manual and it's assumed you can edit the code to suit your needs.
Only speaks jpg and png but that could be extended.
Requirements
Base
- Python 3.9 or later (probably will work with any Python 3 release, only tested on 3.9 and later)
- imagemagick and image format libraries installed and running from the command line (whatever you need for your OS)
- A web host set up to read index.html as default files
Python packages
Use
Copy image files for a single gallery to a folder that will be the latter part of the deployment URL (e.g. amazing-trip).
Run ev15_gallery.py
in the directory and enter gallery data as prompted. This will create a gallery.txt file listing the images (can be edited by hand if desired to change order, etc), and generates thumbnails of various sizes as defined in the configuration section.
To regenerate thumbnails run ev15_gallery.py thumbnails
. To rebuild the index run ev15_gallery.py index
.
The main page (landing page, home page, whatever) is generated by running ev15_index.py
. This reads a simple YAML file containing a list of galleries and builds a landing page with links to each individual gallery. Please see example_index.yaml for reference.
Configuration
Primary configuration is in the top of the gallery generator script, including the location of the imagemagick binary, a list of thumbnail sizes, associated thumbnail suffixes, and quality settings.
Templates
The pages are built using the jinja template engine. For my own site I also use Justified Gallery and the last release of Fancybox, but you can use any design and styling you like.