gaming updates

This commit is contained in:
Greg Kilmer
2026-07-06 19:13:15 -04:00
parent 9b3c15b67b
commit 7808c2ead8
36 changed files with 825 additions and 84 deletions
+89 -2
View File
@@ -1,7 +1,7 @@
# Content Guide
How to add and edit content on the site. Two sections use **Content Collections**
(typed markdown/MDX); the interest pages are hand-built `.astro` files.
How to add and edit content on the site. Four sections use **Content Collections**
(typed markdown/MDX/YAML); the other interest pages are hand-built `.astro` files.
---
@@ -90,6 +90,93 @@ node -e "const m=require('./node_modules/@iconify-json/mdi/icons.json'); console
---
## Games (Gaming page)
The Gaming page (`src/pages/interests/gaming.astro`) has two content-driven
sections that read from collections: **Now playing** and the **Gaming Hall of
Fame**. The platforms grid and favorite-genre cards are still edited inline on
the page.
### Hall of Fame — one file per game
Each game is a markdown file in `src/content/games/hall-of-fame/`. Create a new
file (e.g. `hades.md`):
```md
---
title: 'Hades'
platform: 'Steam' # free-form; drives the icon + platform pill
year: 2020 # optional, shown as a small detail
art: '/images/games/hades.jpg' # optional, public path (see fetch tool below)
artAlt: 'Hades key art' # optional, defaults to the title
icon: 'sword-cross' # optional, overrides the platform-derived icon
blurb: 'A 2-3 sentence case for why it earned a Hall of Fame slot.'
order: 15 # lower = shown first, default 100
---
```
| Field | Type | Required | Notes |
|---|---|---|---|
| `title` | string | yes | Game name |
| `platform` | string | yes | e.g. "PlayStation 5", "Steam", "Nintendo Switch" |
| `blurb` | string | yes | Why it's a favorite |
| `art` | string | no | `/images/games/<slug>.jpg` (public path) |
| `artAlt` | string | no | Alt text, defaults to title |
| `year` | number | no | Release year |
| `icon` | string | no | mdi icon override (else derived from platform) |
| `order` | number | no | Sort weight |
`platform` is matched case-insensitively to pick an icon: `playstation` →
`sony-playstation`, `switch` → `nintendo-switch`, `steam`/`pc` → `steam`,
`xbox` → `microsoft-xbox`, anything else → `gamepad-variant`. Override with
`icon` if you want something specific.
### Now playing — single list
Edit `src/content/games/now-playing.yaml`. This is the transient list of games
you're actively playing; each entry is a title + platform only:
```yaml
games:
- title: "Elden Ring"
platform: "PlayStation 5"
- title: "Balatro"
platform: "Steam"
```
If the list is empty, the page shows a TODO placeholder instead.
### Fetching box art (RAWG)
`scripts/fetch-box-art.mjs` downloads box/banner art from the
[RAWG API](https://rawg.io/apidocs) into `public/images/games/`, then prints the
public path to paste into a game file's `art:` field. RAWG covers Steam,
PlayStation, Xbox, and Nintendo in one place.
1. Get a free key at <https://rawg.io/login?forward=developer> and add it to
`.env` (copy from `.env.example`):
```
RAWG_API_KEY=your_key_here
```
2. Run (Node 20.6+ can auto-load `.env` via `--env-file`):
```bash
node --env-file=.env scripts/fetch-box-art.mjs "Elden Ring"
node --env-file=.env scripts/fetch-box-art.mjs "Hollow Knight" --platform pc
node --env-file=.env scripts/fetch-box-art.mjs --id 3328 # by RAWG id
node --env-file=.env scripts/fetch-box-art.mjs "Celeste" --out celeste.jpg
```
3. It prints something like:
```
✔ Saved: public/images/games/elden-ring.jpg
art: "/images/games/elden-ring.jpg"
```
Paste that `art:` value into the game file's frontmatter.
> RAWG serves **landscape** banner/screenshot art (not portrait Steam
> capsules), which matches the Hall of Fame cards (`aspect-[4/3]`).
---
## Interest pages
Each interest is a hand-built page in `src/pages/interests/`. They follow the