diff --git a/.gitea/workflows/continuous_integration.yaml b/.gitea/workflows/continuous_integration.yaml index aa81e10..53409bf 100644 --- a/.gitea/workflows/continuous_integration.yaml +++ b/.gitea/workflows/continuous_integration.yaml @@ -3,6 +3,7 @@ name: Continuous Integration # Branchstrategie (zie aidlc-docs/.../operations/deployment/deployment-plan.md): # - Pull request → controles, geen deploy # - Merge/push naar master → controles + automatisch naar test +# - Elke nacht (schedule) → controles + naar test, met de pakketten uit het CMS # - Handmatig, elke branch → controles + naar test als 'Deploy to Test' aan staat # - Handmatig, release/* → controles + naar productie als 'Deploy to Production' aan staat on: @@ -20,6 +21,12 @@ on: types: [opened, synchronize, reopened] push: branches: [master] + # Elke nacht een testbuild, zodat een wijziging van de pakketten in het CMS + # op de testsite komt (de build haalt ze op). Alleen test, nooit productie. + # 03:15 UTC (04:15 of 05:15 Nederlandse tijd), buiten kantooruren en niet op + # een heel uur. Gitea draait schedules alleen vanaf de standaardbranch. + schedule: + - cron: '15 3 * * *' # Alleen bij pull requests een verouderde run afbreken; een deploy wordt nooit # halverwege gestopt. @@ -84,6 +91,9 @@ jobs: run: pnpm test # Sentry toont bij elke fout uit welke commit de build komt + # Dit artefact (dist) is ook wat naar productie gaat: bewust zonder + # OFFERINGS_URL, dus met de gecommitte pakketlijst. De testbuild met de + # pakketten uit het CMS is job build-test. - name: Build run: pnpm build env: @@ -102,13 +112,68 @@ jobs: path: web/dist/client/ retention-days: 7 + # De build voor de testsite: zelfde code als dist, maar met de pakketten uit + # het CMS van de testomgeving (OFFERINGS_URL uit de repo-variabele + # ASF_OFFERINGS_URL_TEST). Productie krijgt dit artefact nooit: die blijft op + # dist met de gecommitte lijst tot er een productie-CMS is. + build-test: + needs: check + if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'schedule' + runs-on: linux + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - uses: pnpm/action-setup@v4 + with: + package_json_file: web/package.json + + - name: Get pnpm store directory + id: pnpm-store + run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT" + + - name: Restore pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-${{ hashFiles('web/pnpm-lock.yaml') }} + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build (testomgeving, pakketten uit het CMS) + run: pnpm build + env: + VITE_RELEASE: ${{ github.sha }} + OFFERINGS_URL: ${{ vars.ASF_OFFERINGS_URL_TEST }} + # De testsite staat op zichzelf: canonical, og:url, og:image, + # JSON-LD en sitemap wijzen naar het eigen adres, zodat een gedeelde + # link (WhatsApp, Discord) ook zijn eigen plaatje toont. Alleen in + # deze testbuild; het productie-artefact (job check) krijgt de + # variabele niet en houdt https://andreaslop.nl. + VITE_SITE_URL: https://test.andreaslop.nl + # Het contactformulier staat alleen in deze testbuild open; standaard + # (en in het productie-artefact) is het dicht. Productie aanzetten + # vraagt Bryans expliciete go (docs/go-live-checklist.md). + VITE_CONTACT_FORM_ENABLED: 'true' + + - name: Upload build artifact (test) + uses: actions/upload-artifact@v3 + with: + name: dist-test + path: web/dist/client/ + retention-days: 7 + # Test wacht niet op Lighthouse: test is om te testen, de rapporten zie je # achteraf. Lighthouse draait ernaast of erna (zie de volgorde bovenaan). # Deploys alleen vanaf de Pi: die bereikt zichzelf zeker, en container- # actions werken niet op Podman. deploy-test: - needs: check - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master') + needs: [check, build-test] + if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'schedule' runs-on: raspberry-pi steps: - uses: actions/checkout@v4 @@ -121,7 +186,7 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v3 with: - name: dist + name: dist-test path: web/dist # Alleen de clientmap hoort online: geen servermap, geen source maps @@ -182,6 +247,7 @@ jobs: # Lighthouse tegen de gebouwde site (mobiel en desktop) lighthouse: needs: check + if: github.event_name != 'schedule' runs-on: linux steps: - uses: actions/checkout@v4 diff --git a/AGENTS.md b/AGENTS.md index b5b00be..7b59f4f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,3 +5,4 @@ This file is the entry point for AI coding agents working in this repository. Pr ## Index - [.ai/layout-conventions.md](.ai/layout-conventions.md) — how to build and update the Mermaid diagrams in [LAYOUT.md](LAYOUT.md). +- [README.md](README.md) and [docs/](docs/) — set-up and commands, [CMS integration](docs/cms-integration.md), [deploy and CI](docs/deploy-and-ci.md) and the [go-live checklist](docs/go-live-checklist.md), [translations](docs/translations.md) and the [assets and licences](docs/assets-and-licenses.md). New texts of the site go in `web/src/i18n/nl.json`, not in the components. Update them in the same change when you alter the packages or banners, the use of the CMS API, the workflow (inputs, jobs, triggers), the server config or the go-live conditions. Work that is not built through AI-DLC is documented there, not only in a commit message. diff --git a/README.md b/README.md index 727fd0d..0ec5480 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,36 @@ # Andrea Slop Fotografie -Photography website made with .Net and React for Andrea Slop Fotografie. + +Photography website made with .NET and React for Andrea Slop Fotografie. The site (in [web/](web/)) is a React single-page app (Vite, TanStack Start prerendering, Chakra UI v3) that is prerendered to static HTML at build time. On the test host it is served by the SLP CMS host (.NET), on production the same CMS host behind an IIS pass-through (planned): the host serves the pages, `/admin` and `/api/v1/*`. ## Set-up ### Pre-requisites +- Node.js 24 and pnpm (run every command in [web/](web/)). +- Chrome for the end-to-end checks (`pnpm e2e` uses the installed Chrome; CI uses Playwright's Chromium). + +### Commands (in `web/`) + +| Command | What it does | +| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pnpm install` | Installs the dependencies (also generates the Chakra types). | +| `pnpm dev` | Dev server. Set `API_PROXY_TARGET` (for example the ASF test host) to forward `/api` to a CMS host, so the contact form and the live packages work. | +| `pnpm build` | Fetches the packages and banners from the CMS (see [docs/cms-integration.md](docs/cms-integration.md)), type-checks, builds and prerenders into `dist/`. | +| `pnpm preview` | Serves `dist/` like the host does (headers, redirects). `--contact-stub` answers the contact and offerings API with a stub, as CI does. | +| `pnpm test` | Unit, component, property and axe tests with coverage (100% required for `src/lib/**`). | +| `pnpm e2e` | Real-browser checks against a built `dist/`. | +| `pnpm check` | Everything CI runs: lint, format, tests, build, e2e, audit and Lighthouse. | +| `pnpm server-config` | Regenerates `web/deploy/iis/web.config` and `web/deploy/nginx/*.conf`. Do not edit those by hand. | + ## Lay-out -Lay-out of the website and its pages can be found in a sepoarate document [LAYOUT.md](LAYOUT.md) \ No newline at end of file + +Lay-out of the website and its pages can be found in a separate document [LAYOUT.md](LAYOUT.md). + +## Documentation + +- [docs/cms-integration.md](docs/cms-integration.md): packages and banners from the CMS, the API, the build step, live refresh and the reverse proxy. +- [docs/deploy-and-ci.md](docs/deploy-and-ci.md): the pipeline, the workflow inputs, deploying to test, the nightly build and the contact form switch. +- [docs/assets-and-licenses.md](docs/assets-and-licenses.md): where the images, icons and fonts come from and what is still to confirm about their licence. +- [docs/translations.md](docs/translations.md): where the texts of the site live (language files), how keys work and how a language is added. +- [docs/go-live-checklist.md](docs/go-live-checklist.md): what must be true before the CMS features and the contact form go to production. +- [aidlc-docs/](aidlc-docs/): the AI-DLC records per feature (requirements, design, decisions, audit). [aidlc-docs/active-features.md](aidlc-docs/active-features.md) lists them. diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 291c7d7..fd126a0 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -1,15 +1,20 @@ # Active Features -| Type | Name | Status | Branch | Affected Components | Session Start | -|------|------|--------|--------|---------------------|---------------| -| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 | -| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | -| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 | -| Feature | over-mij-page | ✅ Complete | feature/over-mij-page | web/src/routes/over-mij.tsx, web/src/content, possibly shared components (PageIntro, FramedImage, SectionHeading) and web/src/seo.ts | 2026-10-22 | -| Feature | soorten-fotoshoots-page | ✅ Complete | feature/soorten-fotoshoots-page | web/src/routes/soorten-fotoshoots.tsx, new web/src/content/shootTypes.ts, new web/src/assets/shoots/, new shared CallToAction, MediaText (reverse prop), Pricing (id="prijzen" only), siteContent (service area), own entries in sitePages.ts / lighthouserc.cjs, JSON-LD via the shared webPage() helper in seo.ts | 2026-10-24 | -| Feature | contact-page | ✅ Complete | feature/contact-page | web/src/routes/contact.tsx, web/src/content, possibly ContactForm/ContactSection, PageIntro, MediaText/FramedImage, web/src/seo.ts, sitePages/sitemap | 2026-10-24 | -| Feature | portfolio-page | ✅ Complete | feature/portfolio-page (based on master after over-mij merge; worktree ../AndreaSlopFotografie-portfolio) | web/src/routes/portfolio.tsx, web/src/content, new PortfolioGrid + Lightbox, InstagramGrid (moved to shared), own entries in sitePages.ts / lighthouserc.cjs, ImageGallery JSON-LD via the shared webPage() helper | 2026-10-24 | -| Feature | shoot-type-pages | ✅ Complete (content follow-up: [content-pending.md](features/shoot-type-pages/content-pending.md)) | feature/shoot-type-pages (worktree ../AndreaSlopFotografie-shoot-type-pages) | new route(s) per shoot type under web/src/routes, web/src/content (shootTypes.ts extension, timeline content), shared Timeline component, links from soorten-fotoshoots, seo.ts (webPage helper), sitePages.ts / sitemap, lighthouserc.cjs | 2026-10-29 | -| Feature | prerendering | ✅ Complete (merged, PR #14) | feature/prerendering (worktree ../AndreaSlopFotografie-prerendering) | web/vite.config.ts, web/src/main.tsx, web/index.html, web/config/serverConfig.ts + web/deploy, CI workflow, web/lighthouserc.cjs, possibly Reveal/useReveal and hooks using media queries | 2026-10-31 | -| Feature | testimonials-redesign | ✅ Complete (merged, PR #16) | feature/testimonials-redesign (worktree ../AndreaSlopFotografie-testimonials-redesign) | web/src/components/home/Testimonials (Testimonials, TestimonialSlide, TestimonialCarousel), web/src/recipes/carouselControl.ts, web/src/content (Testimonial type, testimonials.ts), possibly SectionHeading, LAYOUT.md, unit/e2e tests that reference the dots | 2026-11-05 | -| Feature | cms-api-foundation | ✅ Complete (merged PR #17, 2026-11-10; follow-ups: ASF production, contact feature) | feature/cms-api-foundation (worktree ../AndreaSlopFotografie-cms-api-foundation) | Cross-repo: feature briefs for the SlpModularCms repo (new Api.AndreaSlopFotografie client, per-site theming, per-site module set); in this repo only docs, later web integration (CMS serves the site) | 2026-11-05 | +| Type | Name | Status | Branch | Affected Components | Session Start | +| ------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | +| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 | +| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | +| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 | +| Feature | over-mij-page | ✅ Complete | feature/over-mij-page | web/src/routes/over-mij.tsx, web/src/content, possibly shared components (PageIntro, FramedImage, SectionHeading) and web/src/seo.ts | 2026-10-22 | +| Feature | soorten-fotoshoots-page | ✅ Complete | feature/soorten-fotoshoots-page | web/src/routes/soorten-fotoshoots.tsx, new web/src/content/shootTypes.ts, new web/src/assets/shoots/, new shared CallToAction, MediaText (reverse prop), Pricing (id="prijzen" only), siteContent (service area), own entries in sitePages.ts / lighthouserc.cjs, JSON-LD via the shared webPage() helper in seo.ts | 2026-10-24 | +| Feature | contact-page | ✅ Complete | feature/contact-page | web/src/routes/contact.tsx, web/src/content, possibly ContactForm/ContactSection, PageIntro, MediaText/FramedImage, web/src/seo.ts, sitePages/sitemap | 2026-10-24 | +| Feature | portfolio-page | ✅ Complete | feature/portfolio-page (based on master after over-mij merge; worktree ../AndreaSlopFotografie-portfolio) | web/src/routes/portfolio.tsx, web/src/content, new PortfolioGrid + Lightbox, InstagramGrid (moved to shared), own entries in sitePages.ts / lighthouserc.cjs, ImageGallery JSON-LD via the shared webPage() helper | 2026-10-24 | +| Feature | shoot-type-pages | ✅ Complete (content follow-up: [content-pending.md](features/shoot-type-pages/content-pending.md)) | feature/shoot-type-pages (worktree ../AndreaSlopFotografie-shoot-type-pages) | new route(s) per shoot type under web/src/routes, web/src/content (shootTypes.ts extension, timeline content), shared Timeline component, links from soorten-fotoshoots, seo.ts (webPage helper), sitePages.ts / sitemap, lighthouserc.cjs | 2026-10-29 | +| Feature | prerendering | ✅ Complete (merged, PR #14) | feature/prerendering (worktree ../AndreaSlopFotografie-prerendering) | web/vite.config.ts, web/src/main.tsx, web/index.html, web/config/serverConfig.ts + web/deploy, CI workflow, web/lighthouserc.cjs, possibly Reveal/useReveal and hooks using media queries | 2026-10-31 | +| Feature | testimonials-redesign | ✅ Complete (merged, PR #16) | feature/testimonials-redesign (worktree ../AndreaSlopFotografie-testimonials-redesign) | web/src/components/home/Testimonials (Testimonials, TestimonialSlide, TestimonialCarousel), web/src/recipes/carouselControl.ts, web/src/content (Testimonial type, testimonials.ts), possibly SectionHeading, LAYOUT.md, unit/e2e tests that reference the dots | 2026-11-05 | +| Feature | cms-api-foundation | ✅ Complete (merged PR #17, 2026-11-10; follow-ups: ASF production, contact feature) | feature/cms-api-foundation (worktree ../AndreaSlopFotografie-cms-api-foundation) | Cross-repo: feature briefs for the SlpModularCms repo (new Api.AndreaSlopFotografie client, per-site theming, per-site module set); in this repo only docs, later web integration (CMS serves the site) | 2026-11-05 | +| Feature | contact-form-cms | ✅ Complete (closed 2026-11-16; Operations in the joint production checklist; merges with asf-packages-cms) | feature/contact-form-cms (worktree ../AndreaSlopFotografie-contact-form) | web/src/components/ContactForm, ContactFormGate, web/src/contact (submitContactForm), new web/src/cms-client (copied headless package), web/config/securityHeaders.ts, content/siteContent contactForm switch | 2026-11-10 | +| Feature | asf-packages-cms | ✅ Complete (closed 2026-11-16; PR to master after the CMS PR; no production release) | feature/asf-packages-cms (worktree ../AndreaSlopFotografie-packages, based on feature/contact-form-cms) | web/config (offerings, fetchOfferings), web/src/content (packages, snapshot, types), Pricing + PriceBanner + PriceTopBar (two banners, centred card rows), PackagesProvider (live refresh), CI build-test job and nightly test build, docs/ (CMS integration, deploy and CI, go-live checklist) | 2026-11-12 | +| Feature | asf-cms-host-injection | ✅ Complete on the ASF side (2026-11-16, delivered with asf-packages-cms; host side by SMC) | feature/asf-packages-cms | web (PackagesProvider, build markers, neutral HTML), preview server stand-in injector, e2e/contract tests; host side in the SlpModularCms repo | 2026-11-15 | +| Feature | asf-translation-files | ✅ Complete on the ASF side (2026-11-16, delivered with asf-packages-cms) | feature/asf-packages-cms | web/src/i18n (nl.json, helpers), content modules, components, ESLint rules, baseline tool, docs/translations.md | 2026-11-15 | +| Feature | hero-module | 🔵 Inception (requirements questions to Bryan) | (none yet) | Hero as a manageable CMS module (SMC builds the module, ASF consumes it); LCP in the first HTML via host injection or prerender; static hero texts move into it | 2026-11-16 | diff --git a/aidlc-docs/features/asf-cms-host-injection/aidlc-state.md b/aidlc-docs/features/asf-cms-host-injection/aidlc-state.md new file mode 100644 index 0000000..05ec080 --- /dev/null +++ b/aidlc-docs/features/asf-cms-host-injection/aidlc-state.md @@ -0,0 +1,22 @@ +# AI-DLC State Tracking + +## Project Information + +- **Feature Name**: CMS host injects CMS data into the prerendered ASF pages +- **Feature Slug**: asf-cms-host-injection +- **Project Type**: Brownfield (cross-repo: this repo delivers markers, contract and golden files; SlpModularCms owns the injector) +- **Start Date**: 2026-11-15 +- **Current Stage**: COMPLETE on the ASF side (closed 2026-11-16); delivered on branch feature/asf-packages-cms together with [asf-packages-cms](../asf-packages-cms/aidlc-state.md). Host side by SMC (CMS PR). +- **Plan**: [plan.md](plan.md) (approach agreed by Bryan, 2026-11-15) + +## Language Configuration + +- **Documentation Language**: English +- **Conversation Language**: User Language (Dutch) + +## Stage Progress + +- [x] INCEPTION - Requirements and plan (plan.md; decisions (a) brief look change accepted, (b) host writes the list HTML) +- [x] CONSTRUCTION - Code Generation: markers and regions, data block, hydration from the block, JSON-LD price, inline price, own address replacement, stand-in host in the preview server, golden files in `web/contract/host-injection/`, e2e tests, deployment-check normalisation +- [x] CONSTRUCTION - Build and Test: see the asf-packages-cms summary; end-to-end on ASF-test: SMC still to confirm (not part of closing the ASF side) +- [x] OPERATIONS - part of the joint production checklist (production needs IIS pass-through to the CMS host, separate feature) diff --git a/aidlc-docs/features/asf-cms-host-injection/plan.md b/aidlc-docs/features/asf-cms-host-injection/plan.md new file mode 100644 index 0000000..9ef0c29 --- /dev/null +++ b/aidlc-docs/features/asf-cms-host-injection/plan.md @@ -0,0 +1,91 @@ +# Plan (approach agreed, waiting for the start): the CMS host injects CMS data into the prerendered ASF pages + +Status (2026-11-16): ASF side built and closed (see [aidlc-state.md](aidlc-state.md)); host side by SMC. Original status: plan, approach agreed 2026-11-15. + +Decisions of Bryan (via SLS-Main, 2026-11-15): + +- (a) A short change of look of the cards on first paint (neutral HTML first, then the styled cards after hydration) is ACCEPTED. +- (b) The host MAY write the list HTML (C# template; this repo delivers the spec and the golden files): YES. + +It starts as a separate feature after the current merges (contact-form-cms, then asf-packages-cms), not through them. To be built together with SLP Modular CMS - SMC - Main, who owns the host side. + +## Why + +Hosting decision (2026-11-15): the CMS host is the one entry of the website and serves the prerendered pages, `/admin` and `/api/v1/*`; IIS passes everything to it. A CMS change (packages, banners, later gallery and hero) must then be visible to search engines at once, with no rebuild. The host injects the current data into the prerendered HTML through markers (as on SLP, 60 s cache). + +## What is CMS data on the pages today + +Packages: the price cards (home), the shoot list and shoot blocks, the "welke shoot" choices of the contact form, the `?pakket=` check, the offer price in the JSON-LD of the shoot pages. Banners: the slim top bar and the band under the cards. See [docs/cms-integration.md](../../../docs/cms-integration.md). + +## Proposal + +### 1. Three kinds of markers (built into the page by the ASF build, filled by the host) + +- **Data block**, one per page: `` holding the raw answers of `GET /api/v1/offerings` and both banners. The host replaces its content with the current answers (JSON-escaped: `<`, `>`, `&`, U+2028/2029). It is a non-executable block, so the CSP stays as it is and the build step that moves inline scripts treats it as data (as it does for `ld+json`). +- **Region**, for lists that differ in length (the cards, the banners): a wrapper `
` whose content is the neutral HTML. The host replaces everything between `` and `` (written into the wrapper by the build; React cannot emit comments, so the build writes them through `dangerouslySetInnerHTML`). +- **Inline value**, for a single price or name inside a sentence: `€ 185`. The host replaces the text. +- **JSON-LD price** of a shoot page: the `ld+json` block gets `data-cms-offer="newborn"`; the host sets `offers.price` from the live package (or removes `offers` when the package is gone or has no readable price). +- The same marker format as SLP, if SLP already has one (to be confirmed by SMC). + +### 2. Neutral HTML in the markers + +The build puts crawlable, simple semantic HTML between the markers (package name, price, features, a plain link to `/?pakket=#contact`; the banner as an `aside`), written from the baked data by one pure function (`web/src/lib/neutralHtml.ts`, all text escaped). The host produces the same markup from live data (template in C#; the ASF repo delivers the spec and golden files, SMC implements, a contract test in each repo checks both sides against the same fixtures). Light static CSS in the page makes it look acceptable (the section is below the fold). +Why not exact copies of the styled cards: Chakra/Emotion class names and styles are generated at build time, a C# template cannot reproduce them. + +### 3. Hydration: read the JSON, do not fetch + +- `PackagesProvider` takes its initial state from the data block (reusing `mapOfferings`, `mapBanner`, `mapTopBanner`), not from the baked import and not from a fetch after hydration. Without a block (preview, tests, a host that does not inject) it falls back to the baked data plus the live fetch it has today, so nothing is lost. +- Regions are not hydrated by React (`dangerouslySetInnerHTML` with `suppressHydrationWarning`, so React keeps the server DOM). After hydration (`useHydrated`) the styled React components render into the region and replace the neutral HTML. So the first paint is the neutral HTML, and a brief change of look follows; the cards are below the fold, and the region keeps a minimum height to avoid a layout shift. +- Inline values hydrate directly from the same data (`suppressHydrationWarning` for the formatting difference). +- The contact form choices and `?pakket=` read the same state, so they agree with what the host injected. + +### 4. Hydration and contract tests (per marker, before anything ships) + +- Build test: every expected marker exists exactly once per page, in the final `dist/` (after the script-moving step), and the neutral HTML equals what the pure function gives. +- E2E in real Chrome with a stand-in injector in the preview server (same algorithm as the host, fixtures with more, fewer and different packages, with and without banners, an unreadable price, a hostile text such as ``: the host replaces the pair by the live block `{"siteUrl":"…","offerings":[…],"banners":{"top":…|null,"bottom":…|null}}` (offerings and banners exactly as the public GETs; `<`, `>`, `&`, U+2028 and U+2029 written as `\uXXXX` escapes). Without a block after the marker the live block replaces the marker. The block the build bakes carries `"source":"build"` (the host replaces the whole block, so the live one has no `source`); the site treats a block with that source as "no host data" and asks the API itself, as before the injection existed. `siteUrl` is the effective public base URL (see 5), which the client needs because the JS bundle cannot be rewritten (immutable assets). +3. **JSON-LD price** `` directly before ``: the host parses the block and sets `offers.price` (whole euros, our parsing: "€ 175", "€ 1.250", "175,-") on the node that has `offers`; when the package is gone, switched off, scheduled or has no readable price, `offers` is removed from that node. A database or provider failure is different: the baked block stays (fail open). A block that is not valid JSON stays. The marker comment is removed; property order is kept. Only the shoot pages of newborn, zwangerschap and gezin get this marker; loveshoot, portret ("Prijs op aanvraag"), the overview and the home page get none. +4. **Inline value** `€ 185`: the host replaces the text by "€" + U+00A0 + whole euros; an unknown slug or an unreadable price leaves the span alone. Only simple, non-nested spans with exactly this attribute. Used in the price block of a shoot page. +5. **Own address** (`Website:AuthoredBaseUrl`): the same injector replaces the written production address in every HTML page, `sitemap.xml` and `robots.txt` by `Website:PublicBaseUrl` when that is set on the host (test: `https://test.andreaslop.nl`; production: equal or empty, nothing to replace). One artifact then serves test and production, and `VITE_SITE_URL` no longer differs per environment. The ASF build is written with `https://andreaslop.nl` (the non-www canonical origin; IIS redirects www to it). The site has no web manifest. The client takes its address from `siteUrl` in the data block (fallback: the production address), not from the bundle, so canonical and `og:` tags stay right after hydration and on navigation. +6. **Caching:** injected pages get `Cache-Control: no-cache`, a strong ETag (hash of the final body), 304 on `If-None-Match` and no Last-Modified, behind the host's 60 s cache with direct invalidation on every CMS change. `/assets/` stays immutable. Pages without markers keep the native static-file headers. + +### Neutral HTML spec (draft; golden files follow once Bryan has approved the approach) + +- Order: `displayOrder`, then the order given. Skip a package with a slug that is not `[a-z0-9-]+`, a duplicate slug, no title, a price that is not readable as whole euros above zero, or no features (same rules as `mapOfferings`). The baked fallback stays when the host has no live data at all. +- Per package: `
  • Newborn

    € 185

    • …
    Boek Newborn
  • ` inside one `