Fixes from the reference site: 404 page unlisted, own-origin media, fillGlobal defaults, switcher docs

- sitemap, llms.txt and the site index leave out the page assigned as the 404
  page (unlistedPageIds, exported); it stays when it is also the homepage
- buildImagesConfig: in production with R2_PUBLIC_URL empty, allow the site's
  own /api/media/file/** so next/image no longer answers 400
- fillGlobal: a choice field (select, radio, checkbox, number, date) still at its
  defaultValue counts as empty; text is never overwritten
- docs: LanguageSwitcher renderLabel needs a 'use client' wrapper (i18n.md,
  ipal-site, ipal-setup, api.md)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 15:29:07 +01:00
co-authored by Claude Opus 5.5
parent d992d131a2
commit 3645e61f7d
19 changed files with 171 additions and 18 deletions
+6 -4
View File
@@ -259,10 +259,12 @@ variable; the component follows automatically.
- `buildImagesConfig({ serverUrl?, production?, publicUrl?, extraHosts? })` → `images` in
`next.config.ts`: `formats` AVIF + WebP, `minimumCacheTTL` 31 days, `remotePatterns` from
`R2_PUBLIC_URL` (`publicUrl`) and `extraHosts` (https). Outside production (`production`, default
`NODE_ENV === 'production'`) also media served by the app — `/api/media/file/**` on
`NEXT_PUBLIC_SERVER_URL` (`serverUrl`) — and `dangerouslyAllowLocalIP: true` for localhost /
private networks (Next 16 rejects them otherwise). Spread the result and override:
`R2_PUBLIC_URL` (`publicUrl`) and `extraHosts` (https). Media served by the app — `/api/media/file/**` on
`NEXT_PUBLIC_SERVER_URL` (`serverUrl`) — are allowed outside production (`production`, default
`NODE_ENV === 'production'`) **and in production when `R2_PUBLIC_URL` is empty** (the default without R2:
Payload gives absolute URLs on the site's own host, which next/image would refuse with 400). Outside
production also `dangerouslyAllowLocalIP: true` for localhost / private networks (Next 16 rejects them
otherwise); a production build on localhost never gets it — set `production: false` for such a test run. Spread the result and override:
`images: { ...buildImagesConfig(), /* your own */ }`.
- `buildUploadSecurityHeaders({ collections? })` (default `['media']`) → headers for
`/api/<slug>/file/:path*`: sandbox CSP + `nosniff` (uploaded SVG without scripts). security.md.