Make profile identity, bio and fonts configurable

The profile header, photo page byline and copyright footer previously
hardcoded the author name, handle, bio, and font choices. Move all of
these to CLI flags on the binary and matching options on the NixOS
module so the same build can serve any single-user gallery.

New surface, all with defaults matching the previous hardcoded values:
  --author       / services.photogallery.author
  --handle       / services.photogallery.handle
  --bio          / services.photogallery.bio
  --bio-alt      / services.photogallery.bioAlt   ("" to omit)
  --fonts-url    / services.photogallery.fontsURL
  --serif-family / services.photogallery.serifFamily
  --ml-family    / services.photogallery.mlFamily

Templates read the two font families from a small inline <style> that
overrides the :root variables, so the stylesheet stays fully static and
the font URL is loaded via the configured stylesheet link.

README updated to describe the new options, the medium/full-size photo
detail flow, and the EXIF-based date prefill on the upload page.
This commit is contained in:
2026-07-02 02:30:35 +02:00
parent ec42a65c5b
commit 51b082ccf4
6 changed files with 152 additions and 31 deletions
+28
View File
@@ -8,6 +8,16 @@ A minimal static photo gallery with an Atom feed and an upload API.
2. The binary watches the directory and rebuilds the static site on any change.
3. nginx serves `public/` and proxies `/upload` to the local API, secured with htpasswd.
For each photo the generator produces a 600×600 square thumbnail for the grid
and an aspect-preserved medium JPEG (longest side 1600) for the detail page.
The original file stays reachable from a download link on the detail page.
Regeneration is skipped when the destination is at least as new as the source,
so editing one sidecar doesn't reprocess every photo.
The upload page reads `DateTimeOriginal` from a JPEG's EXIF (or falls back to
the file's modification time) and prefills the date field, which stays
editable before submitting.
## Sidecar format
```toml
@@ -48,6 +58,17 @@ services.photogallery = {
enable = true;
baseURL = "https://photos.yourdomain.tld";
# Optional: identity shown on the header and copyright footer
author = "Ada Lovelace";
handle = "@ada@example.com";
bio = "Photos from the field.";
bioAlt = ""; # optional secondary line in the alt-script font
# Optional: swap fonts
fontsURL = "https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;600;700&family=Manjari:wght@400;700&display=swap";
serifFamily = "EB Garamond";
mlFamily = "Manjari";
# Optional: built-in nginx vhost
nginx = {
enable = true;
@@ -73,6 +94,13 @@ nix-shell -p apacheHttpd --run \
| `contentDir` | `/var/lib/photogallery/content` | Images and .toml sidecars |
| `outputDir` | `/var/lib/photogallery/public` | Generated site output |
| `port` | `8080` | Upload API port (localhost only) |
| `author` | `Ashik Salahudeen` | Name shown on the header, photo pages and copyright footer |
| `handle` | `@puttaalu@inflo.ws` | Handle line under the author name |
| `bio` | `Personal photo journal.` | Primary bio line |
| `bioAlt` | Malayalam default | Secondary bio line in the alt-script font (`""` to omit) |
| `fontsURL` | Crimson Pro + Manjari | Stylesheet URL loading both web fonts |
| `serifFamily` | `Crimson Pro` | CSS font-family for the primary serif |
| `mlFamily` | `Manjari` | CSS font-family for the alt-script bio |
| `nginx.enable` | `false` | Configure an nginx vhost |
| `nginx.domain` | — | Domain for the vhost |
| `nginx.htpasswdFile` | — | htpasswd file for `/upload` |