Gallery
Static photo gallery for logging meals and food memories.
The site is based on the HTML5 UP Lens template and currently ships as a plain static site: HTML, CSS, JavaScript, and local image assets.
Repo Layout
templates/index.html: source template for the main gallery pageindex.html: generated static gallery pageassets/: site CSS, JavaScript, fonts, and audioimages/fulls/: full-size gallery imagesimages/thumbs/: gallery thumbnailsdata/meals.json: source of truth for gallery entriesscripts/build.js: renders static pages from templates and datascripts/generate-thumbnails.js: regenerates thumbnails from the full-size imagespackage.json: minimal Node build entrypoint
Content Workflow
Gallery entries live in data/meals.json, and index.html is generated from templates/index.html.
After editing content or templates, rebuild the site with:
npm run build
The build currently renders the main page without changing the existing Lens gallery structure, so the current client-side viewer code continues to work.
If you only need to regenerate thumbnails, run:
npm run build:thumbs
To force a full thumbnail rebuild, run:
npm run build:thumbs:force
Image Conventions
- Full-size images and thumbnails share the same numeric ID
- Full-size images live at
images/fulls/<id>.jpg - Thumbnails live at
images/thumbs/<id>.jpg positioncontrols the full-screen viewer image alignmentthumbnail.focusoptionally overrides the default center crop for generated thumbnails
Thumbnail Focus
Thumbnails are generated from images/fulls with sharp at 240x320.
The generator auto-rotates images using EXIF orientation, skips unchanged files by default, and removes stale thumbnail .jpg files that no longer map to a meal entry.
For images that should crop away from the center, add optional thumbnail focus metadata to the meal entry:
{
"id": "34",
"title": "example",
"description": "example",
"thumbnail": {
"focus": {
"x": 0.35,
"y": 0.45
}
}
}
The x and y values are normalized from 0 to 1, where 0.5, 0.5 is the center of the image.
Planned Features
- Automatic image ingestion, potentially with a stronger data model if the static workflow becomes too limiting.
- An Elo-style ranking page that shows two food images at a time and updates rankings automatically based on the selected winner.
- General cleanup and history cleanup once the bigger structural changes are in place.