An automated Python script to generate a static image gallery website from a directory of images.
- Creates thumbnail galleries where each image can be clicked to view in full-size.
- Automatic pagination with 20 images per page.
- Includes navigation links: Home, Previous, Next, and About.
- Uses Jinja2 templating engine for flexibility in design.
- Outputs the entire static website to an
output
directory.
- Python 3.x
- Jinja2
To install Jinja2, run:
pip install jinja2
- Clone or download this repository.
- Place your images in the
images
directory. You can also organize them in sub-folders within theimages
directory. - Run the
generate_gallery.py
script:
python generate_gallery.py
- The static HTML pages will be generated inside the
output
directory. You can then deploy this folder to any web server or host it using services like GitHub Pages, Netlify, etc.
If you want to change the appearance or structure of the gallery, you can edit the Jinja2 templates in the templates
directory:
gallery.html
: The main gallery page template.about.html
: The About page template.style.css
: The CSS styles for the entire site.
After making changes, rerun the generate_gallery.py
script to regenerate the static pages.
Contributions, issues, and feature requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.
If you found this helpful, please consider:
- Buymeacoffee: Link