Merge remote-tracking branch 'origin/master' into feature/hero-module

This commit is contained in:
2026-11-17 09:01:43 +01:00
5 changed files with 19 additions and 23 deletions
+3 -3
View File
@@ -11,10 +11,10 @@ Source: `GET /api/v1/offerings`. One list feeds the price cards on the home page
- **Where the data comes from, in order:**
1. At build time `web/config/fetchOfferings.ts` (the first step of `pnpm build`) asks `OFFERINGS_URL` (10 s timeout, 2 attempts) and writes the gitignored `web/src/content/offerings.generated.json`. The packages are baked into the prerendered HTML (search engines see the prices, no layout jump).
2. Without `OFFERINGS_URL`, with a CMS that is down or with an unusable answer, the committed `web/src/content/offerings.snapshot.json` is used. The build never fails and never shows empty prices; the log says which source was used. Tests always use the snapshot.
3. After hydration `PackagesProvider` (`web/src/components/PackagesProvider/`) asks the CMS once and replaces the baked list only if the answer differs. A network error, time-out (8 s), bad status or invalid answer keeps what was baked. A change in the CMS therefore shows at once; the nightly build only matters for search engines.
3. After hydration `PackagesProvider` (`web/src/components/PackagesProvider/`) asks the CMS once and replaces the baked list only if the answer differs. A network error, time-out (8 s), bad status or invalid answer keeps what was baked. A change in the CMS therefore shows at once. Where the CMS host serves the site (ASF-test), it also writes the current data into the first HTML of every request (NFR-10), so search engines see it too and no rebuild is needed for content; a rebuild is only for code and design.
- **Featured package** (the star in the CMS admin, field `featured`): the card gets a heidegroen rule along its top, a heidegroen border and a small "Uitgelicht" tab on the top edge (`PriceCard`). The tab is positioned on the border, so the cards of a row keep the same layout. Any number of cards may be featured.
- **Description, price note and button label** (`description`, `priceNote`, `ctaLabel`) are optional in the CMS and the site does not use them: they are not shown and a card never depends on them (empty, `null` or absent all give the same card; covered by tests).
- **Scheduling in the CMS:** the API only returns packages that are live at the moment of the request (switched on and inside their from/to dates), so the site shows them and nothing else. The baked list reflects the moment of the build; the live refresh after hydration corrects it for every visitor, and the nightly build corrects it for search engines. A package that goes live or expires between two builds is therefore right in the browser but can be stale in the HTML until the next build.
- **Scheduling in the CMS:** the API only returns packages that are live at the moment of the request (switched on and inside their from/to dates), so the site shows them and nothing else. The baked list reflects the moment of the build; the live refresh after hydration corrects it for every visitor, and, behind the CMS host, the host injection corrects the HTML itself (cache 60 s, refreshed at once on a change). Without the host (production until the IIS pipeline is in place) a package that goes live or expires between two builds is right in the browser but can be stale in the HTML until the next build.
- **Keep the snapshot current** when the real packages change (prices, features), because production builds use it (see "Hosting" below).
## Banners (OfferingBanner)
@@ -30,7 +30,7 @@ Source: `GET /api/v1/offerings/banner?position=top|bottom`. No parameter means `
Both follow the same rules as the packages: baked into the HTML at build time, replaced live after hydration, empty fields are hidden, an error or invalid answer keeps what was baked. A `204` hides that banner (the one deliberate exception to "keep what was baked"); the two banners are independent of each other. Neither banner is a package: not in the form choices, not in the package count.
**Layout shift:** a banner that was not active at the last build is not in the HTML. When it appears live, the content below it moves down by its height once (for the top bar, the cards move). Rebuilding with the banner active (the nightly test build does this) removes the shift. The same holds in reverse when a baked banner is switched off.
**Layout shift:** a banner that was not active at the last build is not in the HTML. When it appears live, the content below it moves down by its height once (for the top bar, the cards move). Behind the CMS host the host injection writes the banner into the HTML, so there is no shift; without the host a rebuild with the banner active removes it. The same holds in reverse when a baked banner is switched off.
## Hero (CMS module)