Revive garden site: Vigo identity, about page, sessions listing, live API estate dashboard
- Update identity references: Vigilio → Vigo in garden.css and session log - Add About page with Vigo's identity, protocol, wake modes, and estate info - Add Sessions listing with proper _index.md and menu entry - Add live API fetch (estate.js): try /api/ first, fall back to /data/ JSON - Update menu in hugo.toml with sessions (4) and about (5) - Fix duplicate nav entries by removing menu frontmatter from estate page - Update README with build strategies (API online/offline) Hugo build: 208 pages, 21 static files, 110ms
This commit is contained in:
parent
ef45cf166b
commit
5762508193
127 changed files with 378 additions and 146 deletions
26
README.md
26
README.md
|
|
@ -62,7 +62,17 @@ The site is a **hybrid**: static content (writings, expressive forms) lives in t
|
|||
- Hugo v0.123+ (extended)
|
||||
- Trentuna Estate API running on `127.0.0.1:8000` (or configure `/api/` to point elsewhere)
|
||||
|
||||
### Build
|
||||
### Build with API data
|
||||
|
||||
```bash
|
||||
cd ~/releases/garden.trentuna.com
|
||||
bash scripts/prebuild-fetch.sh # fetches live API data into static/data/
|
||||
hugo
|
||||
```
|
||||
|
||||
### Build without API (offline / no API running)
|
||||
|
||||
Static data files are already in `static/data/` — Hugo will use the last fetched snapshots:
|
||||
|
||||
```bash
|
||||
cd ~/releases/garden.trentuna.com
|
||||
|
|
@ -75,7 +85,7 @@ hugo
|
|||
hugo server -D
|
||||
```
|
||||
|
||||
Opens at `http://localhost:1313`. Note: the `/api/` proxy won't be available locally — API-dependent sections will show "Estate API unavailable".
|
||||
Opens at `http://localhost:1313`. Note: the `/api/` proxy won't be available locally — API-dependent sections will fall back to the static data files in `/data/`.
|
||||
|
||||
## Deployment
|
||||
|
||||
|
|
@ -89,9 +99,17 @@ nginx serves `/srv/garden` for `garden.trentuna.com` and reverse-proxies `/api/*
|
|||
|
||||
## API Integration
|
||||
|
||||
Client-side JavaScript (`static/js/estate.js`) fetches from the Estate API via nginx reverse proxy at `/api/`:
|
||||
Client-side JavaScript (`static/js/estate.js`) fetches from the Estate API via nginx reverse proxy at `/api/`, with automatic fallback to build-time static JSON snapshots in `/data/`:
|
||||
|
||||
| Garden Section | API Endpoint | Method |
|
||||
### Fetch strategy
|
||||
|
||||
The JS (`estate.js`) tries the live API first (via `/api/` proxy → `localhost:8000`). If the API is unreachable, it falls back to static JSON data files in `/data/` that are generated by `scripts/prebuild-fetch.sh` at build time. This means:
|
||||
|
||||
- **API running** → live data on every page load
|
||||
- **API offline** → last known data from last build, still rendered
|
||||
- **No network** (local dev without API) → fallback data files render with loaded timestamps
|
||||
|
||||
| Garden Section | API Endpoint | Static Fallback |
|
||||
|----------------|-------------|--------|
|
||||
| Homepage pulse | `/api/summary` | GET |
|
||||
| Homepage pulse | `api/trends?limit=1` | GET |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue