---
name: project-directory
description: Maintain the living project-directory landing page at the root of oswaldjpickles.from-ca.com (192.168.0.12). Use when asked to refresh/update/regenerate the homepage directory, after publishing new sites or Gitea repos, or to change how the directory looks or what it lists. The page lists all deployed sites and auto-extends from what's served + what's on Gitea.
---

# Project Directory (root landing page)

The server's root `index.html` is a **living directory** of deployed projects. It reads a `projects.json` catalog (generated server-side) on every page load. New projects appear automatically once the catalog is regenerated.

## How it works (architecture)

- **Public page** (`index.html`) is hosted publicly, but Gitea is LAN-only — so the browser CANNOT query Gitea directly. Therefore the catalog is generated **server-side**.
- **Generator:** `~/fc-project/gen-directory.sh` (on the server) scans the web root for servable directories + their entry pages, queries Gitea (credentials stay on the server), and writes a **public-safe** `projects.json` (live `/Site/` links only — no LAN URLs, no creds).
- **Page** fetches `projects.json?_=<timestamp>` on each load (cache-busted) → "refresh on load," **no cron** (Jon's explicit choice).
- Design intent: **elegant simplicity** — a quiet single-column list, restrained type, auto light/dark, subtle hover only. Jon dislikes busy/gradient/"unfocused" designs. Keep it minimal.

## Refresh the catalog (most common task)

After publishing/deploying a new site or repo, regenerate the catalog:
```bash
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 jonathan@192.168.0.12 \
  'bash ~/fc-project/gen-directory.sh'
```
The page picks it up on the next load. Verify:
```bash
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 jonathan@192.168.0.12 \
  'curl -sk -o /dev/null -w "/ -> %{http_code}\n" https://oswaldjpickles.from-ca.com/; \
   curl -sk -o /dev/null -w "projects.json -> %{http_code}\n" https://oswaldjpickles.from-ca.com/projects.json'
```

## Edit the page design

1. The deployed file is `~/fc-project/web/html/index.html` on the server.
2. **Back up first**, then edit/redeploy via the `server-deploy` skill (Workflow B — root page).
3. Keep it minimal per Jon's taste. The page is data-driven: it reads `projects.json` fields `name`, `path`, `entry`, `pages[]`, `inGit`, `updated`.

## Edit what gets listed / detection

Edit the generator `~/fc-project/gen-directory.sh`:
- `CANDIDATES` = entry-page filenames to detect (index/home/main/app/queue/customer/dashboard.html). Add more if a site uses a different entry page.
- `SKIP_REGEX` = directory names to exclude (`_archive`, `_assets`, asset/infra dirs).
- Dirs with no servable page are skipped (e.g. API-only proxied apps).
- Gitea cross-ref key = lowercased name with spaces→hyphens; sets `inGit` + `updated`.

After editing, re-run the generator (above). The generator is the single source of truth for the catalog; the page is just a renderer.

## Constraints

- **Only ever change root `index.html` + `projects.json`.** Never touch sibling project directories — they are live sites served from the same web root.
- Keep `projects.json` public-safe: live links only, never embed Gitea credentials or LAN-only URLs.
