# Frequently Changed Sections Architecture

This is the standing data/content rule for this design pack and its section-folder library.

Source spec:

- `/Users/marknuttall/Documents/Claude/Projects/design-pack-frequently-changed-sections-spec.md`

## Core Rule

- Frequently changed content lives in JSON data files, not inline section markup.
- The generator reads the JSON; the design remains fixed.
- To change content, edit the relevant JSON, then regenerate, audit, validate, commit, push and deploy.
- Do not hand-edit `section.partial.html`, page templates, shared CSS or generated HTML for ordinary content updates.
- SEO-critical JSON content must be pre-rendered into the initial HTML. Do not hide prices, hours, events, facilities, contact details or date stamps behind client-only JavaScript.

## Pack Status

Current pack:

- `steam-live-photo-website-starter`

Current JSON already present:

- Source-backed page archive JSON:
  - `new-site/content/pages/<page-slug>.json`
- Design-pack examples:
  - `data/pages.source.json`
  - `data/components.example.json`
  - `data/site-content.example.json`
  - `data/navigation.example.json`
- Section-library metadata JSON:
  - `demos/sections/<section-slug>/section.json`
  - `demos/sections/home-v5-section-map.json`
- Section-library content JSON:
  - `demos/sections/<section-slug>/content.json`

Required section-folder content source:

- `demos/sections/<section-slug>/content.json`

`section.partial.html` is generated from `content.json` by `scripts/build-home-v5-section-library.mjs`. The rendered partial is crawlable HTML, but it is not the editable content source.

## Partials Vs JSON

### Build-Time Partials / Fixed Design

These are structural chrome and design scaffolds. They may be edited only when the design system changes:

- header and navigation shell;
- drawer menu shell and behaviour;
- footer and back-to-top utility;
- hero shell and stat-card layout;
- CTA layout shells;
- page wrappers and section wrappers;
- reusable `demos/sections/<section-slug>/section.partial.html`;
- shared CSS and JavaScript.

### JSON Data Files

These are frequently changed content. They must be edited in section-folder JSON only:

| Section | JSON location | Notes |
| --- | --- | --- |
| Prices, entry fees, passes, membership tiers | `demos/sections/<section-slug>/content.json` | One source for every price display in that section. |
| Opening hours | `demos/sections/<section-slug>/content.json` | Include per-day notes and event tags here, not by hand-editing the partial. |
| Events / what's on | `demos/sections/<section-slug>/content.json` | Weekly, monthly and one-off event data. |
| Facilities | `demos/sections/<section-slug>/content.json` | Chips/lists/cards all render from this file. |
| Offers and promotions | `demos/sections/<section-slug>/content.json` | Seasonal passes and promo rows. |
| Verified / last updated stamp | `demos/sections/<section-slug>/content.json` | One value must propagate everywhere the section renders it. |
| News / reports feed | `demos/sections/<section-slug>/content.json` plus per-item JSON if the section later needs it | Feed order and item metadata stay data-driven. |
| Featured / most-viewed strip | `demos/sections/<section-slug>/content.json` | May be runtime-enhanced only when non-indexed. |
| Contact block | `demos/sections/<section-slug>/content.json` | Phone, address and contact routes. |

## Update Paths

Section-folder content update command:

```bash
/Users/marknuttall/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node scripts/build-home-v5-section-library.mjs && /Users/marknuttall/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node scripts/audit-section-folder-typography.mjs && ./scripts/prepare-public-upload.sh
```

Current source-backed page archive command:

```bash
/Users/marknuttall/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node scripts/build-steam-json-batch.mjs && /Users/marknuttall/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node scripts/gate-steam-json-batch.mjs && ./scripts/prepare-public-upload.sh
```

Per-section update commands all follow the same rule:

- prices: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- opening hours: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- events: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- facilities: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- offers: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- freshness/date stamp: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- news/reports feed: edit the relevant section folder's `content.json` or per-item JSON if introduced, then run the section-folder content update command;
- featured/most-viewed: edit the relevant section folder's `content.json`, then run the section-folder content update command;
- contact block: edit the relevant section folder's `content.json`, then run the section-folder content update command.

Deployment still requires the normal project rule:

- commit and push the matching source state before Cloudflare Pages deploy;
- deploy only `.pages-upload`.

## Validation Rules

- A bad JSON edit must fail validation before deployment.
- A section value must not be duplicated by hand in another JSON file, partial or HTML page.
- If the same value appears in more than one rendered place, it must be propagated by sync from one JSON source.
- Deployments must be coupled to the committed and pushed source state.
- Runtime JavaScript may enhance non-indexed widgets only; SEO-critical content must be visible in initial HTML.
