Writing README file, moving image folder and generated output into "gallery" subdirectory

main v0.1.0
Nekkowe 2025-01-09 18:25:45 +01:00
parent 525aa1a0d8
commit 7a57c1187d
7 changed files with 31 additions and 8 deletions

8
.gitignore vendored
View File

@ -1,5 +1,5 @@
/media/*
/thumbs/*
gallery-items.csv
gallery-items-backup-*
gallery/**
!gallery/**/
!gallery/**/.gitkeep
gallery-items*.csv
__pycache__

View File

@ -7,8 +7,8 @@ from ffmpeg import FFmpeg, Progress
from lib import GalleryTable
TABLE_PATH = Path(__file__, "..", "gallery-items.csv").resolve()
MEDIA_FOLDER = Path(__file__, "..", "media").resolve()
THUMBNAIL_FOLDER = Path(__file__, "..", "thumbs").resolve()
MEDIA_FOLDER = Path(__file__, "..", "gallery", "media").resolve()
THUMBNAIL_FOLDER = Path(__file__, "..", "gallery", "thumbs").resolve()
THUMBNAIL_SUFFIX = "-thumb.webp"
THUMBNAIL_MAX_FRAMES = 0 # No limit. Feel free to adjust this if you're hosting long animations on there or something.

View File

@ -7,8 +7,8 @@ from lib import GalleryTable
GALLERY_ID = "gallery" # e.g. <div id="gallery"/>
GALLERY_CONFIG_PATH = Path(__file__, "..", "nanogallery2-config.json").resolve()
JAVASCRIPT_OUTPUT_PATH = Path(__file__, "..", "gallery.js").resolve()
HTML_OUTPUT_PATH = Path(__file__, "..", "gallery.html").resolve()
JAVASCRIPT_OUTPUT_PATH = Path(__file__, "..", "gallery", "gallery.js").resolve()
HTML_OUTPUT_PATH = Path(__file__, "..", "gallery", "index.html").resolve()
TABLE_PATH = Path(__file__, "..", "gallery-items.csv").resolve()
MEDIA_FOLDER = Path(__file__, "..", "media").resolve()

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# Static Gallery Generator (couldn't think of a decent name yet)
A free, open-source tool to automatically generate a gallery of your art, to put up on your personal website. Automatically creates thumbnails, the JS and the HTML (which you can then edit further to your liking). The gallery at the core is [nanogallery2](https://nanogallery2.nanostudio.org/).
I wanted to make this dead simple to set up and use, but it's definitely not quite there yet.
## Requirements
1. [Python](https://www.python.org/downloads/), to run the scripts
2. [FFmpeg](https://ffmpeg.org/), to create the thumbnails (, good installation instructions available here: https://ultahost.com/knowledge-base/install-ffmpeg-on-windows/)
## How to Use
1. Place images or videos in the `gallery/media/` folder
2. Run `1-generate-thumbnails-and-table.py`
3. (optional) Edit the newly created `gallery-items.csv` to add titles, descriptions and tags
4. Run `2-generate-gallery.py`
5. (This part will probably change as I figure out ways to make this more accessible)
Upload the `gallery` folder to your neocities and edit `index.html` to your liking!
If you want to change settings for how the gallery looks and works, you can either make changes to `nanogallery2-config.json` before running the scripts or to `gallery/gallery.js` afterwards.
A detailed list of all possible settings is available [here](https://nanogallery2.nanostudio.org/documentation.html).

0
gallery/.gitkeep Normal file
View File

0
gallery/media/.gitkeep Normal file
View File

0
gallery/thumbs/.gitkeep Normal file
View File