add: elo data model and static rankings page
All checks were successful
Deploy on push / deploy (push) Has been skipped
All checks were successful
Deploy on push / deploy (push) Has been skipped
This commit is contained in:
15
README.md
15
README.md
@@ -7,19 +7,23 @@ The site is based on the HTML5 UP Lens template and currently ships as a plain s
|
||||
## Repo Layout
|
||||
|
||||
- `templates/index.html`: source template for the main gallery page
|
||||
- `templates/rankings.html`: source template for the rankings page
|
||||
- `index.html`: generated static gallery page
|
||||
- `rankings.html`: generated static rankings page
|
||||
- `assets/`: site CSS, JavaScript, fonts, and audio
|
||||
- `images/fulls/`: full-size gallery images
|
||||
- `images/thumbs/`: gallery thumbnails
|
||||
- `data/meals.json`: source of truth for gallery entries
|
||||
- `data/elo.json`: Elo ratings, record totals, and ranking settings
|
||||
- `scripts/build.js`: renders static pages from templates and data
|
||||
- `scripts/generate-thumbnails.js`: regenerates thumbnails from the full-size images
|
||||
- `scripts/ingest-meal.js`: ingests a new meal image and metadata in one command
|
||||
- `scripts/lib/elo.js`: validates and syncs Elo data against the meal list
|
||||
- `package.json`: minimal Node build entrypoint
|
||||
|
||||
## Content Workflow
|
||||
|
||||
Gallery entries live in `data/meals.json`, and `index.html` is generated from `templates/index.html`.
|
||||
Gallery entries live in `data/meals.json`, and the build generates both `index.html` and `rankings.html` from the template and data files.
|
||||
|
||||
After editing content or templates, rebuild the site with:
|
||||
|
||||
@@ -27,7 +31,7 @@ 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.
|
||||
The gallery build keeps the existing Lens thumbnail markup intact, so the current client-side viewer code continues to work.
|
||||
|
||||
To ingest a new meal image and update the site in one command, run:
|
||||
|
||||
@@ -52,6 +56,11 @@ To force a full thumbnail rebuild, run:
|
||||
npm run build:thumbs:force
|
||||
```
|
||||
|
||||
## Rankings Data
|
||||
|
||||
`data/elo.json` stores the seed rating, Elo `kFactor`, and a win-loss record for each meal.
|
||||
The page build keeps this file aligned with `data/meals.json`, so new meals automatically appear in `rankings.html` with the default seed rating.
|
||||
|
||||
## Image Conventions
|
||||
|
||||
- Full-size images and thumbnails share the same numeric ID
|
||||
@@ -85,5 +94,5 @@ The `x` and `y` values are normalized from `0` to `1`, where `0.5, 0.5` is the c
|
||||
|
||||
## Planned Features
|
||||
|
||||
1. An Elo-style ranking page that shows two food images at a time and updates rankings automatically based on the selected winner.
|
||||
1. A pairwise voting page that shows two food images at a time and updates Elo rankings based on the selected winner.
|
||||
2. General cleanup and history cleanup once the bigger structural changes are in place.
|
||||
|
||||
Reference in New Issue
Block a user