Docs: admin languages and texts, wording rule for agents, new screen names
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6b46bc0c14
commit
0a2374db18
+51
-35
@@ -62,7 +62,8 @@ Write new rules, AGENTS.md entries and plugin-gap reports in English.
|
||||
6. **A section = a composition of UI primitives.** `buildLinksField()` + `<CMSLink>`, upload +
|
||||
`<Media>`, `<Section>` + `<SectionHeader>`. No `ctaLabel`/`pdfUrl` fields.
|
||||
**A clear panel** (§6.5a): repeated items = an "+ Add …" array with `rowLabel`, never
|
||||
`cta1`/`cta2`; labels in English, short; no empty "just in case" fields.
|
||||
`cta1`/`cta2`; labels short and in the panel's languages (`{ en, pl }`, guide
|
||||
`docs/dev/admin-ux.md`); no empty "just in case" fields.
|
||||
7. **Renderers from the plugin:** `RenderBlocks` (not a `switch`), `RenderRichText` (not
|
||||
your own Lexical parser), `useForm` (not hand-made form plumbing).
|
||||
8. **No `any` and no `@ts-ignore`.** Types from `@/payload-types`, `unknown` + guard.
|
||||
@@ -96,21 +97,21 @@ site), **P** = a test in the panel. Full code: PROGRAMISTA.md §2.
|
||||
| # | Area | What must exist (file) | Plugin API | Check |
|
||||
|---|---|---|---|---|
|
||||
| 1 | i18n + routing | `src/proxy.ts`, `[locale]/[[...slug]]/page.tsx` = `createPageRoute(content, {…})` + a literal `revalidate`, `not-found.tsx` = `createNotFoundPage(content, { load })` + `notFoundView.ts` (`renderNotFoundView`) | `createProxy`, `createContentHelpers`, `createPageRoute`, `createNotFoundPage` (`/rsc`) | A, S |
|
||||
| 2 | **SEO** — meta | `generateMetadata` in every page route; favicon and OG from Site Settings; `htmlLimitedBots` in `next.config.ts`; SEO tab + `buildNoindexField` in Pages | `generatePageMetadata`, `buildIconsMetadata`, `buildNoindexField` | A, S |
|
||||
| 2 | **SEO** — meta | `generateMetadata` in every page route; favicon and OG from Site settings; `htmlLimitedBots` in `next.config.ts`; SEO tab + `buildNoindexField` in Pages | `generatePageMetadata`, `buildIconsMetadata`, `buildNoindexField` | A, S |
|
||||
| 3 | **SEO** — maps | `src/app/sitemap.xml/route.ts` (`export { sitemapRoute as GET }` + `force-dynamic`), `src/app/robots.ts` (`export { getRobots as default }` + `force-dynamic` — AI bots from the panel), `src/app/manifest.ts` — re-exports from `lib/content` | `sitemapRoute`, `getRobots` (or `robots` without the panel), `manifest` | A, S |
|
||||
| 3a | **Search Console / Bing** | recommended: **domain verification via DNS** (TXT record, deployment.md §6) — the plugin does nothing, the verification fields stay empty; only for URL-prefix verification: code in **Site Settings → Search & AI** (Google, Bing, Yandex), `generatePageMetadata` adds the `<meta>` itself; sitemap `https://<domain>/sitemap.xml` submitted in GSC and Bing | panel (optional), `verificationFrom` | P |
|
||||
| 4 | **SEO** — structured data | layout: `<SiteProviders shell={…}>` gives `WebSite` + `Organization` (`sameAs`) from Site Settings; local business → `createContentHelpers({ siteJsonLd })` with `buildLocalBusinessJsonLd` (`type`, hours → `formatOpeningHours`); navigation: `<SiteProviders jsonLd={[buildNavigationJsonLd(…)]}>`; page: `createPageRoute` adds `getPageJsonLd` (WebPage/BlogPosting, breadcrumbs, FAQ — `pageJsonLd: { faq }`) | `getSiteShell`, `SiteProviders`, `build*JsonLd`, `getPageJsonLd` | A, S |
|
||||
| 3a | **Search Console / Bing** | recommended: **domain verification via DNS** (TXT record, deployment.md §6) — the plugin does nothing, the verification fields stay empty; only for URL-prefix verification: code in **Site settings → Search engines** (Google, Bing, Yandex), `generatePageMetadata` adds the `<meta>` itself; sitemap `https://<domain>/sitemap.xml` submitted in GSC and Bing | panel (optional), `verificationFrom` | P |
|
||||
| 4 | **SEO** — structured data | layout: `<SiteProviders shell={…}>` gives `WebSite` + `Organization` (`sameAs`) from Site settings; local business → `createContentHelpers({ siteJsonLd })` with `buildLocalBusinessJsonLd` (`type`, hours → `formatOpeningHours`); navigation: `<SiteProviders jsonLd={[buildNavigationJsonLd(…)]}>`; page: `createPageRoute` adds `getPageJsonLd` (WebPage/BlogPosting, breadcrumbs, FAQ — `pageJsonLd: { faq }`) | `getSiteShell`, `SiteProviders`, `build*JsonLd`, `getPageJsonLd` | A, S |
|
||||
| 5 | **GEO** — llms | `src/app/llms.txt/route.ts` (`llmsRoute`) and `src/app/llms-full.txt/route.ts` (`llmsFullRoute`) from `lib/content`; the `buildSummaryField()` field in Pages, `summaryField: 'aiSummary'` in `createContentHelpers` | `llmsRoute`, `llmsFullRoute`, `buildSummaryField` | A, S |
|
||||
| 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts` (single-language: `src/app/md/[[...slug]]/route.ts`) = `export { markdownRoute as GET } from '@/lib/content'`; `createContentHelpers({ markdownAlternate: true })` (link in `<head>`); `createProxy(…, { NextResponse, markdown: true })` (without it `/md/…` gets redirected to a language) | `markdownRoute`, `markdownAlternate`, `createProxy({ markdown })` | A, S |
|
||||
| 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` = `export { mcpGET as GET, mcpPOST as POST } from '@/lib/content'` (public — AI browses the site: `get_site_info`, `list_pages`, `search_content`, `get_page`); name: `createContentHelpers({ mcp: { serverName } })` | `mcpGET`, `mcpPOST` | A, S |
|
||||
| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site Settings → Search & AI → AI crawlers (works only with `getRobots`); `ipalKit({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IPAL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S |
|
||||
| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site settings → Search engines → AI assistants (works only with `getRobots`); `ipalKit({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IPAL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S |
|
||||
| 9 | **Media / R2 / speed** | `Media` with `focalPoint`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` + field; **always** `buildR2Storage(['media'], { s3Storage })` + `@payloadcms/storage-s3`; `R2_*` in `.env.example`; `<MediaPreconnect/>`; `images: buildImagesConfig()` and `buildUploadSecurityHeaders()` in `next.config.ts`; the project's `<Media>` via `mediaImageProps`/`videoProps` (§6.11b) | `buildR2Storage`, `mediaImageProps`, `videoProps`, `buildImagesConfig` | A, S |
|
||||
| 10 | **Forms** | every form from a **seed** (`scripts/seed-form-*.ts`: fields, confirmation, mail to the company **and** confirmation to the customer, every language); a block with `<RenderForm>` + `formClasses.ts` (look, once); `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` in `ipalKit`; `email: mailAdapter()` | `RenderForm` (`/rsc`), `createSubmitAction`, `mailAdapter` | A, P |
|
||||
| 11 | **Turnstile** | `<SiteProviders>` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site Integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P |
|
||||
| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`<SiteProviders analytics={{ consentMode: 'basic' }}>` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; `ipalKit({ consentLog: true })` (without it the `/api/ipal/consent` endpoint does not exist) + `<SiteProviders logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />}>` (ConsentProvider, banner, CookieButton, Analytics in the right order); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → the editor accepts; or cookie-scan → import) — feeds `<CookieTable>` on the policy page **and** the lists in the `detailed` window; Cookie Settings → Detail labels in every language | consent.md, analytics.md | A, `ipal-consent-check` |
|
||||
| 11 | **Turnstile** | `<SiteProviders>` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P |
|
||||
| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`<SiteProviders analytics={{ consentMode: 'basic' }}>` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; `ipalKit({ consentLog: true })` (without it the `/api/ipal/consent` endpoint does not exist) + `<SiteProviders logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />}>` (ConsentProvider, banner, CookieButton, Analytics in the right order); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → the editor accepts; or cookie-scan → import) — feeds `<CookieTable>` on the policy page **and** the lists in the `detailed` window; Cookie banner → Settings window → Cookie list headings in every language | consent.md, analytics.md | A, `ipal-consent-check` |
|
||||
| 13 | Security | `buildSecurityHeaders` in `next.config.ts`; `twoFactor: { issuer, plugin: payloadTotp }`; CSP `report-only` → `enforce`; `IPAL_IP_HEADER` in production | security.md, forms.md | A |
|
||||
| 14 | Operations | `src/app/api/health/route.ts` (`healthRoute`); `src/instrumentation.ts` with `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))`; staging with `IPAL_NOINDEX=1`; smoke tests (§8a) | `healthRoute`, `assertEnv`, `ipalEnvRules` | A |
|
||||
| 15 | System pages | Site Settings → System Pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P |
|
||||
| 15 | System pages | Site settings → System pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P |
|
||||
| 16 | **Nothing hardcoded** | every text, link, image, file, company data from the panel; domains and keys from `.env` (§2) | — | A, P |
|
||||
| 17 | **Content** | one h1, the answer at the start of each section, facts, internal links, FAQ from real questions, `aiSummary`, sameAs, consistent company data (§0c) | — | S, P |
|
||||
| 18 | **Scaling** | `fluid.css` / `fluid-wide.css`, hero on `--ipal-hero-min-h`, the screen list in §6.11a (including 1366×768) | — | A, browser |
|
||||
@@ -132,9 +133,9 @@ Do not make the provider or the widget conditional in code — always wire them.
|
||||
| reCAPTCHA, hCaptcha, your own captcha | a second mechanism, no status in the panel | Turnstile from the plugin |
|
||||
| a hand-written `<script type="application/ld+json">` | no escaping, drifts from the panel | `JsonLdGraph` |
|
||||
| your own `sitemap.ts` / a text `robots.txt` in `public/` | no hreflang, noindex or system pages | `sitemapRoute`, `getRobots` from `lib/content` |
|
||||
| a verification `<meta>` / `google*.html` file in code or `public/` | a deploy for every change; the code belongs to the client | DNS verification, or the code in Site Settings → Search & AI |
|
||||
| a verification `<meta>` / `google*.html` file in code or `public/` | a deploy for every change; the code belongs to the client | DNS verification, or the code in Site settings → Search engines |
|
||||
| your own `llms.txt` in `public/` | static, goes stale | `llmsRoute` / `llmsFullRoute` from `lib/content` |
|
||||
| your own link function (`resolveHref`, `getHref`…): the homepage slug in code (`=== 'home'`), `` `/${slug}` `` | no language prefix, the homepage depends on Site Settings, `javascript:` from the panel in `href`, a dead link leads to `/` | `resolveLink(link, locale)` / `resolveNav` from `lib/content` (field: `buildLinkField`) |
|
||||
| your own link function (`resolveHref`, `getHref`…): the homepage slug in code (`=== 'home'`), `` `/${slug}` `` | no language prefix, the homepage depends on Site settings, `javascript:` from the panel in `href`, a dead link leads to `/` | `resolveLink(link, locale)` / `resolveNav` from `lib/content` (field: `buildLinkField`) |
|
||||
| `page` + `url` + `label` fields in globals, `prefooterButtonUrl`, `ctaLabel`; style based on content (`label === 'Tesla'`); legal link labels in code | the editor cannot choose a file / new tab / style; renaming breaks the look; Polish text in the English version | `buildLinkField` / `buildLinksField` with `appearances`, `resolveNav`, `getSystemLinks` |
|
||||
| `@aws-sdk/client-s3` / your own upload to the bucket | bypasses the media hooks and the URL from `R2_PUBLIC_URL` | `buildR2Storage` |
|
||||
|
||||
@@ -176,13 +177,13 @@ the panel (seed, phase 6 in ipal-site), apply the rules below — without invent
|
||||
- An **About us** page with people, experience, certificates (from the brief); posts with an author and a date.
|
||||
- **The same company data everywhere** (name, address, phone): footer, contact, JSON-LD
|
||||
(`LocalBusiness`/`Organization`), Google Business Profile. One Company global as the source.
|
||||
- **Site Settings → sameAs:** the company's profiles (Google Business Profile, LinkedIn, Facebook…).
|
||||
- **Site Settings → site description** (2–3 sentences: who, what, where) — feeds llms.txt, MCP and meta.
|
||||
- **Site settings → sameAs:** the company's profiles (Google Business Profile, LinkedIn, Facebook…).
|
||||
- **Site settings → site description** (2–3 sentences: who, what, where) — feeds llms.txt, MCP and meta.
|
||||
- **`aiSummary`** of important pages: fix the auto-fill when the summary is weak (1–3 sentences, facts).
|
||||
|
||||
### Meta in the SEO tab
|
||||
Title ≤ 60 characters, unique, key phrase first; description ≤ 155 characters, with specifics and a call to action;
|
||||
a share image (1200×630) on pages with an offer — the rest inherit the default from Site Settings.
|
||||
a share image (1200×630) on pages with an offer — the rest inherit the default from Site settings.
|
||||
A description **unique on every page** — an empty one is filled from the content on save, but a hand-written
|
||||
one is better. Google ignores the same description on many pages.
|
||||
|
||||
@@ -428,7 +429,7 @@ the editor composes pages from them. A new page = no code.
|
||||
|
||||
### 5.3 MINIMUM collections
|
||||
By default: `pages`, `media` + the plugin's globals (`site-settings`,
|
||||
`site-integrations`, Notifications, Cookie Settings) + the project's globals
|
||||
`site-integrations`, Notifications, Cookie banner) + the project's globals
|
||||
(navigation, footer, company). Nothing more until the client explicitly requires it.
|
||||
|
||||
**`users`** is added by `ipalKit` (an auth collection with `roles` and 2FA) — do not create it, unless
|
||||
@@ -460,7 +461,7 @@ Every content collection: `title`, `buildSlugField`, SEO tab, `buildNoindexField
|
||||
`trackSlugHistoryHook`, structured data if relevant (seo.md). Details: content.md.
|
||||
|
||||
### 5.5 System pages
|
||||
Site Settings → System Pages: `homepage`, `notFound` (404), `privacyPolicy`,
|
||||
Site settings → System pages: `homepage`, `notFound` (404), `privacyPolicy`,
|
||||
`cookiePolicy`, `termsOfService`. Link by role (`getSystemPagePath`),
|
||||
never by slug. pages.md.
|
||||
|
||||
@@ -480,7 +481,7 @@ Three problems that must never repeat: **a zoo of CTA fields** (`ctaLabel`,
|
||||
3. **Repeated items = an "+ Add …" array**, never numbered fields. Buttons: `buildLinksField()` →
|
||||
the editor clicks "Add Button" as many times as needed (`maxRows` = as many as the design fits).
|
||||
`cta1`/`cta2`/`cta3`, `feature1Title`…, `image2` = an audit error.
|
||||
4. **A panel readable without knowing the code:** English labels of 1–3 words, collapsed rows with content
|
||||
4. **A panel readable without knowing the code:** `{ en, pl }` labels of 1–3 words, collapsed rows with content
|
||||
(`rowLabel`), ≤ 6 items visible after adding a block, technical settings in the sidebar.
|
||||
5. **A variant instead of a copy:** a different look of the same section = `variant` (select), not a second block.
|
||||
6. **No text, link or image in JSX** — everything from the panel, in every language.
|
||||
@@ -523,7 +524,7 @@ before uploading — the hook only catches mistakes and asks for consent.
|
||||
- `buildSectionSettingsField()` → the `settings` group (sidebar): `anchor`, `background`
|
||||
(project backgrounds: `buildSectionSettingsField({ backgrounds: [{ label, value }] })`, extra fields: `fields`).
|
||||
Every section has `buildSectionSettingsField()` — no `bgColor`, `sectionId` per block.
|
||||
Field labels in English (the panel is in English).
|
||||
Field labels as `{ en, pl }` objects (the panel runs in English and Polish; §6.5a).
|
||||
|
||||
### 6.3 Layer 2 — UI primitives
|
||||
|
||||
@@ -611,11 +612,26 @@ empty fields, without guessing, without numbered slots. You design the schema fo
|
||||
2. **A row shows its content**: `admin: { initCollapsed: true, components: rowLabel('heading', 'Feature') }`
|
||||
→ collapsed rows "Fast delivery", "24/7 support" instead of "Feature 01".
|
||||
`buildLinksField` has this built in (row = button label).
|
||||
3. **The panel in English, short.** `label` 1–3 words, Sentence case ("Heading",
|
||||
"Background"); `admin.description` only when the label is not enough — one
|
||||
sentence ≤ 80 characters: what it does / where it shows, with a format example
|
||||
(`'Section id for #links, e.g. "pricing".'`), never how the code works. Select options
|
||||
with a readable `label` ("Inverted (dark)"), not the raw value.
|
||||
3. **The panel in the editors' languages, short — follow `docs/dev/admin-ux.md`**
|
||||
(`node_modules/@intecion/ipal-kit/docs/dev/admin-ux.md`): its glossary, sentence case,
|
||||
field order and tab / sidebar / collapsible rules.
|
||||
- Every visible field has an explicit `label` — never Payload's auto-label from the name
|
||||
(`ctaUrl` → "Cta Url"). Label 1–3 words, ≤ 30 characters.
|
||||
- Texts are `{ en: '…', pl: '…' }` (one key per admin language of the project):
|
||||
`label`, `admin.description`, option `label`, tab `label`, `labels.singular/plural`,
|
||||
`admin.group`. Type: `AdminText` from `@intecion/ipal-kit`.
|
||||
- `admin.description` only when the label is not enough — one sentence ≤ 120 characters:
|
||||
what it does / where it shows, with a format example (`'Section id for #links, e.g. "pricing".'`),
|
||||
never how the code works (no component, function, env-var or package names).
|
||||
- Select options with a readable `label` ("Inverted (dark)"), not the raw value.
|
||||
- The admin panel runs in English and Polish by default (ipal-kit sets
|
||||
`i18n.supportedLanguages` when the project has not); set your own list to change it.
|
||||
The plugin's own texts are overridable: field/global labels via `globalOverrides` /
|
||||
`collectionOverrides`, component texts via `i18n.translations.<lang>.ipal.<key>`
|
||||
(keys: `adminTexts` from `@intecion/ipal-kit`). Building blocks for your own admin
|
||||
components: `ipalT`, `formatNumber`, `formatDateTime`, `defineTexts`, `ADMIN_LANGUAGES`,
|
||||
`applyAdminI18n` (already applied by `ipalKit`), types `AdminText`, `AdminLanguage`, `AdminTextKey`
|
||||
— details in i18n.md "Admin panel languages and texts".
|
||||
4. **No "just in case" fields.** Every field is displayed by the component; an empty
|
||||
optional field = the element does not render (the component handles it). Hide
|
||||
dependent fields: `admin.condition` (video fields only with `mediaType: 'video'`,
|
||||
@@ -699,11 +715,11 @@ Skill: **ipal-nav**.
|
||||
- Navigation, footer, company data = **project globals** (`header`, `footer`, `company`),
|
||||
built with `buildLinkField` — the company data model depends on the country (NIP/ABN/EIN).
|
||||
- Menu: one level of submenu, no deeper. The CTA in the header = `links`.
|
||||
- Logo and name from Site Settings — do not duplicate the fields in Header.
|
||||
- Logo and name from Site settings — do not duplicate the fields in Header.
|
||||
- **Footer content in `<NoSnippet>`** (`/rsc`, inside `<footer>`) — otherwise Google shows the address
|
||||
from the footer as the description of every subpage. The same for the contact bar and a CTA repeated on
|
||||
every page. Never on `<main>`. Details: seo.md → "Descriptions in Google".
|
||||
- **Legal links in the footer** from the System Pages roles: `await getSystemLinks(locale)` (href + page title), not by hand and with no labels in code.
|
||||
- **Legal links in the footer** from the System pages roles: `await getSystemLinks(locale)` (href + page title), not by hand and with no labels in code.
|
||||
- Highlighting a menu item / a button variant = `appearance` from the panel (`buildLinkField({ appearances: [...] })`, any names), never a condition on content (`label === '…'`).
|
||||
- Resolve links **on the server**: `await resolveNav(header.navItems, locale)` from `lib/content`
|
||||
→ `{ href, label, internal, newTab, targetProps, children }[]` (dead links skipped); only this data
|
||||
@@ -711,9 +727,9 @@ Skill: **ipal-nav**.
|
||||
- a11y labels (menu button) — fields in the panel.
|
||||
- A global changed on every page → `afterChange: [buildGlobalRevalidateHook({ revalidatePath })]`
|
||||
(it calls `revalidatePath('/', 'layout')`). `buildRevalidateHook` is for collections. The plugin's globals
|
||||
(Site Settings, Site Integrations, Cookie Settings, Notifications) refresh ISR themselves once you pass
|
||||
(Site settings, Site integrations, Cookie banner, Notifications) refresh ISR themselves once you pass
|
||||
`ipalKit({ revalidatePath })` (from `next/cache`); without it the change shows after the `revalidate` window.
|
||||
- The plugin's globals: read public (Site Integrations: admin only), write editor+. Change their access, admin
|
||||
- The plugin's globals: read public (Site integrations: admin only), write editor+. Change their access, admin
|
||||
or hooks with `ipalKit({ globalOverrides: { notifications: { access: { update: authenticated } } } })` —
|
||||
an object merges key by key (your keys win), a function `(global) => global` takes over. Never copy a plugin global.
|
||||
- Only `[locale]/layout.tsx` fetches globals and passes them as props.
|
||||
@@ -742,7 +758,7 @@ Skill: **ipal-nav**.
|
||||
8. **An enlarged image is never a hand-made modal** (no `useState(index)` + `div role="dialog"`,
|
||||
`glightbox`, `photoswipe`, a link to the raw file in a new tab) — `<LightboxTrigger>` around the
|
||||
thumbnail (a client component you render from a server block with plain `lightboxImage(…)` data),
|
||||
one `<SiteProviders lightbox>`, labels from Notifications → Lightbox (lightbox.md). `ipal-audit`
|
||||
one `<SiteProviders lightbox>`, labels from Form messages → Image viewer (lightbox.md). `ipal-audit`
|
||||
warns about lightbox libraries and hand-made image dialogs.
|
||||
|
||||
### 6.10 Icons
|
||||
@@ -875,7 +891,7 @@ project → **plugin gap**, not a copy.
|
||||
| Unusual form markup | `BuilderForm renderField` / `useBuilderForm` (`/client`) | forms.md |
|
||||
| A field filled in by the page (product variant, category) | `RenderForm values` / `prepareBuilderForm` + `BuilderForm values` | forms.md |
|
||||
| Sending | `createSubmitAction({ getCachedPayload, headers })` (`/server`) | forms.md |
|
||||
| Message texts and step button texts | Notifications → `getFormTexts(locale)` | notifications.md |
|
||||
| Message texts and step button texts | Form messages → `getFormTexts(locale)` | notifications.md |
|
||||
| A form in the database | seed `ipal-form/resources/seed-form.template.ts` | forms.md, seeding.md |
|
||||
| Antispam / limit / IP | honeypot in `BuilderForm`, Turnstile from `SiteProviders` (`createSubmitAction({ turnstileHostnames })` pins the domain), `clientIp`, `setRateLimitStore`, `setUnknownIpFactor` | forms.md, turnstile.md |
|
||||
| GTM event after sending | `buildFormAnalyticsFields` (panel) — `RenderForm` sends it itself | forms.md |
|
||||
@@ -886,7 +902,7 @@ project → **plugin gap**, not a copy.
|
||||
|---|---|---|
|
||||
| Metadata, canonical, hreflang, OG, X | `generatePageMetadata` (`createPageRoute` does it itself) | seo.md |
|
||||
| sitemap / robots / manifest | `sitemapRoute` (splits into a sitemap index above 10 000 URLs; `sitemapOptions`, `sitemapEntries`), `getRobots` (panel) / `robots` (code only), `manifest` | seo.md |
|
||||
| Search Console / Bing verification, AI crawler policy, llms.txt note | Site Settings → Search & AI (`searchSettings`); building blocks `verificationFrom`, `robotsOptionsFrom` | seo.md |
|
||||
| Search Console / Bing verification, AI crawler policy, llms.txt note | Site settings → Search engines (`searchSettings`); building blocks `verificationFrom`, `robotsOptionsFrom` | seo.md |
|
||||
| JSON-LD | `getSiteShell().jsonLd`, `getPageJsonLd`, `build*JsonLd`, `formatOpeningHours`, `sameAsUrls`, `<JsonLdGraph>` | seo.md |
|
||||
| Product / category JSON-LD (an entry that is not an article) | `pageJsonLd.entries` + `buildProductJsonLd` | seo.md |
|
||||
| llms.txt / llms-full / Markdown / MCP | `llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`/`mcpPOST`; `markdownAlternate: true`; `createProxy({ markdown: true })` | seo.md, content.md, mcp.md |
|
||||
@@ -898,7 +914,7 @@ project → **plugin gap**, not a copy.
|
||||
|---|---|---|
|
||||
| R2, file names, optimization, preview | `buildR2Storage`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` | storage.md |
|
||||
| Image / video in `<Media>` | `mediaImageProps`, `videoProps`, `MEDIA_SIZES` | storage.md |
|
||||
| Enlarge an image (card, gallery, product, rich text) | `<SiteProviders lightbox>` + `<LightboxTrigger group image={lightboxImage(media, { size })}>` (`/client`), `RenderRichText lightbox`, `useLightbox`; labels: `ipalKit({ lightbox: true })` → Notifications → Lightbox | lightbox.md |
|
||||
| Enlarge an image (card, gallery, product, rich text) | `<SiteProviders lightbox>` + `<LightboxTrigger group image={lightboxImage(media, { size })}>` (`/client`), `RenderRichText lightbox`, `useLightbox`; labels: `ipalKit({ lightbox: true })` → Form messages → Image viewer | lightbox.md |
|
||||
| YouTube without cookies before a click | `<YouTubeEmbed>` (`/client`) | storage.md |
|
||||
| `next.config` | `buildImagesConfig`, `buildSecurityHeaders`, `buildCsp`, `buildUploadSecurityHeaders` | storage.md, security.md |
|
||||
| Fluid typography and spacing | `fluid.css` / `fluid-wide.css` (`--ipal-*` variables) | PROGRAMISTA §2.5 |
|
||||
@@ -919,7 +935,7 @@ project → **plugin gap**, not a copy.
|
||||
| Rate limit (forms, MCP, search) | built in; IP from `IPAL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md |
|
||||
|
||||
**Compliance (PL/EU) — the mechanism from the plugin, the content from the client:** policy pages
|
||||
as System Pages, `CookieBanner` + `CookieButton`, a `consent` checkbox in
|
||||
as System pages, `CookieBanner` + `CookieButton`, a `consent` checkbox in
|
||||
forms (enforced server-side), the controller's data in a global, the cookie
|
||||
table from the panel (`<CookieTable>` and the `settings="detailed"` window, scan: ipal-consent-check). You do not write legal texts. An accessibility widget — only when the client
|
||||
requires it (accessibility.md).
|
||||
@@ -932,10 +948,10 @@ payloadTotp } })`, never `twoFactor: false` without a client decision). CSP: fir
|
||||
|
||||
| Feature (default) | Turn off | Override / building blocks |
|
||||
|---|---|---|
|
||||
| Plugin globals: write editor+ (Site Integrations: admin) | — | `ipalKit({ globalOverrides: { <slug>: { access, admin, hooks } } })`; a function `(global) => global` takes over (`applyGlobalOverrides`) |
|
||||
| Plugin globals: write editor+ (Site integrations: admin) | — | `ipalKit({ globalOverrides: { <slug>: { access, admin, hooks } } })`; a function `(global) => global` takes over (`applyGlobalOverrides`) |
|
||||
| Global saves revalidate the layout (with `ipalKit({ revalidatePath })`) | omit `revalidatePath`; once: `context: { disableRevalidate: true }` | `buildGlobalRevalidateHook` on your own globals |
|
||||
| Staff features without `access` (no roles field): every logged-in account passes (`userMeetsRole`) | add `access` (roles decide) | `globalOverrides`, `forms.formSubmissionOverrides`, `consentLog.collectionOverrides`, `stats.collectionOverrides` |
|
||||
| Cookie crawl (`crawl`): start editor+ or the token, results token-only for the running job, latest result only, dashboard warning on, e-mail off until recipients are set | omit `crawl`; `crawl.dashboard: false` | `crawl.serviceUrl` / `token` / `siteUrl` / `maxPages` / `acceptSelector` / `consentMode` / `trackerHosts` / `globalOverride`; *Cookie crawl → E-mail warnings to*; building blocks `ingestCrawlResult`, `findCrawlViolations`, `parseCrawlResult` |
|
||||
| Cookie check (`crawl`): start editor+ or the token, results token-only for the running job, latest result only, dashboard warning on, e-mail off until recipients are set | omit `crawl`; `crawl.dashboard: false` | `crawl.serviceUrl` / `token` / `siteUrl` / `maxPages` / `acceptSelector` / `consentMode` / `trackerHosts` / `globalOverride`; *Cookie check → Warning e-mails to*; building blocks `ingestCrawlResult`, `findCrawlViolations`, `parseCrawlResult` |
|
||||
| Cookie review: scan + review editor+, delete admin; Open Cookie Database "Functional" → `functional` | omit `cookieScanner` | `cookieScanner.access`, `collectionOverrides`, `databaseCategories`, `integrations`, `declarations`, `labels`, `syncAccepted: false`; building blocks `runCookieScan`, `collectCookieFindings`, `applyCookieFindings` |
|
||||
| Consent records / stats visits: read and delete admin (stats view and chart follow `stats-visits` read access) | omit `consentLog` / `stats` | `consentLog.collectionOverrides`, `stats.collectionOverrides` (object merges `access`/`admin`/`hooks`, function takes over; `applyCollectionOverride`) |
|
||||
| Injected `users`: admin manages everyone, others only themselves | — | `access.authAccess` (your keys win); your own `users` collection wins whole |
|
||||
@@ -951,7 +967,7 @@ payloadTotp } })`, never `twoFactor: false` without a client decision). CSP: fir
|
||||
| `getSettings` at `depth: 1` | — | `createContentHelpers({ settingsDepth: 2 })` (every request pays) |
|
||||
| Image lightbox (off) | — (opt-in: `<SiteProviders lightbox>`, `LightboxTrigger`, `RenderRichText lightbox`, `ipalKit({ lightbox: true })` for panel labels) | `texts`, `classNames`, `unstyled`, `--ipal-lightbox-*` variables, `renderImage`, `renderDialog`, `loop`, `useLightbox`, `withLightboxUploads`, `lightboxImage` |
|
||||
| `RenderRichText` renders unsafe link URLs as `#` | `safeLinks={false}` (fully trusted content only) | your own `converters` |
|
||||
| Search & AI tab in Site Settings | `searchSettings: false` (top level, works without `seo`; `seo.searchSettings` still works) | `searchSettings: (fields) => fields`; `verificationFrom`, `robotsOptionsFrom` |
|
||||
| Search engines tab in Site settings | `searchSettings: false` (top level, works without `seo`; `seo.searchSettings` still works) | `searchSettings: (fields) => fields`; `verificationFrom`, `robotsOptionsFrom` |
|
||||
| Verification `<meta>` from the panel | empty fields = no tag | `const { verification, ...meta } = await generatePageMetadata(…)` |
|
||||
| AI crawler policy from the panel | `robots` instead of `getRobots`; policy `default` | `buildRobots({ ...robotsOptionsFrom(settings), aiBotRules })`; `AI_ASSISTANT_BOTS`, `AI_TRAINING_BOTS` |
|
||||
| Sitemap split / CDN cache / memo | `sitemapOptions: { maxUrls: Infinity, cacheControl: false, memoSeconds: 0 }` | `sitemapEntries`, `createSitemapRouteHandler`, `buildSitemapIndexXml`, `buildSitemapEntries` |
|
||||
@@ -980,7 +996,7 @@ Rules:
|
||||
texts the editor will change tomorrow.
|
||||
- **Every fixed bug = a test** that would have caught it (smoke or vitest), so it does not come back.
|
||||
- **Test the form for real**: sending → a record in Form Submissions → mail to the company **and**
|
||||
confirmation to the customer (locally: Site Integrations → Send test + adapter logs).
|
||||
confirmation to the customer (locally: Site integrations → Send test + adapter logs).
|
||||
- **Do not test the plugin in the project** (e.g. whether `submitForm` validates) — ipal-kit does that. When
|
||||
the plugin's behavior is wrong: plugin gap.
|
||||
- Tests in the project's CI: types + audit `--quick` + build on every push; smoke on staging
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: ipal-block
|
||||
description: Builds or refactors one page section (Payload block + React component) in an ipal-kit project the correct way — a clean editor panel (repeatable things as "+ Add …" arrays with rowLabel, never cta1/cta2 slots, short English labels, no empty spare fields), shared fields from the plugin (buildSectionHeaderField, buildLinksField, buildLinkField, buildSectionSettingsField), UI primitives (Section, SectionHeader, Media, CMSLink), fixed field vocabulary, max ~80 lines of JSX, subcomponents for repeated items, registry wiring. Use when creating a new section/block (hero, features, CTA, FAQ, gallery, pricing, testimonials…), changing a block's fields, or fixing a block with ctaLabel/buttonUrl/pdfUrl fields or a monolithic component.
|
||||
description: Builds or refactors one page section (Payload block + React component) in an ipal-kit project the correct way — a clean editor panel (repeatable things as "+ Add …" arrays with rowLabel, never cta1/cta2 slots, short `{ en, pl }` labels per docs/dev/admin-ux.md, no empty spare fields), shared fields from the plugin (buildSectionHeaderField, buildLinksField, buildLinkField, buildSectionSettingsField), UI primitives (Section, SectionHeader, Media, CMSLink), fixed field vocabulary, max ~80 lines of JSX, subcomponents for repeated items, registry wiring. Use when creating a new section/block (hero, features, CTA, FAQ, gallery, pricing, testimonials…), changing a block's fields, or fixing a block with ctaLabel/buttonUrl/pdfUrl fields or a monolithic component.
|
||||
---
|
||||
|
||||
# ipal-block
|
||||
@@ -49,7 +49,8 @@ File patterns (Hero, FeatureGrid + FeatureCard): `resources/section-code.md`.
|
||||
|
||||
## 3. Check
|
||||
- `Component.tsx` ≤ ~80 lines of JSX.
|
||||
- **Empty block test** in the panel: ≤ 6 items at the start, everything in English,
|
||||
- **Empty block test** in the panel: ≤ 6 items at the start, every label and description
|
||||
readable in English and Polish (switch the admin language in Account),
|
||||
"+ Add Button / Add Feature", collapsed rows showing their content, every field shows something.
|
||||
First `rowLabel` in the project → `pnpm payload generate:importmap`.
|
||||
- Run the **ipal-audit** skill (`--quick`), fix every `[ERROR]`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: ipal-collection
|
||||
description: Decides whether something should be a Payload collection, a global, or a block, and builds a content collection the ipal-kit way (title, buildSlugField, SEO tab, buildNoindexField, trackSlugHistoryHook, revalidate hook, archive page from System Pages, sitemap and routing via content option). Use when the user asks for a blog, news, products, portfolio, testimonials, authors, categories, or any new collection — and whenever you are about to create a file in src/collections.
|
||||
description: Decides whether something should be a Payload collection, a global, or a block, and builds a content collection the ipal-kit way (title, buildSlugField, SEO tab, buildNoindexField, trackSlugHistoryHook, revalidate hook, archive page from System pages, sitemap and routing via content option). Use when the user asks for a blog, news, products, portfolio, testimonials, authors, categories, or any new collection — and whenever you are about to create a file in src/collections.
|
||||
---
|
||||
|
||||
# ipal-collection
|
||||
@@ -35,10 +35,11 @@ Ask only when the brief leaves a business question open (e.g. "do posts have aut
|
||||
`buildRevalidateHook`, `setPublishedAtHook` (dated entries), uploads via
|
||||
`media`, links via `buildLinkField()`. Field names per AGENT.md §6.5.
|
||||
Panel (AGENT.md §6.5a): `admin.useAsTitle`, `defaultColumns` (3–4), `admin.group: 'Content'`,
|
||||
`labels` in English, arrays with `labels` + `rowLabel()`, settings in the sidebar.
|
||||
`labels` and every field `label` as `{ en, pl }` (rules: `docs/dev/admin-ux.md` in the package),
|
||||
arrays with `labels` + `rowLabel()`, settings in the sidebar.
|
||||
2. With URLs: add it to `content.config.ts` → `{ slug, perPage }`.
|
||||
**No URL prefix in code** — the editor assigns the archive page in
|
||||
Site Settings (`<slug>Archive`). The plugin handles routing, sitemap,
|
||||
Site settings (`<slug>Archive`). The plugin handles routing, sitemap,
|
||||
generateStaticParams, hreflang.
|
||||
3. Entry list = a block (EntriesList) with `getEntries`; the entry page uses
|
||||
`resolveRoute` (type `entry`); JSON-LD per seo.md (e.g. Article).
|
||||
|
||||
@@ -27,7 +27,7 @@ before analytics or marketing consent — check the project's choice in "Project
|
||||
|
||||
| Violation | Cause → fix |
|
||||
|---|---|
|
||||
| pixel loaded without consent | script wired by hand / copied `Analytics` → ID in Site Integrations, `<Analytics>` from the plugin (analytics.md) |
|
||||
| pixel loaded without consent | script wired by hand / copied `Analytics` → ID in Site integrations, `<Analytics>` from the plugin (analytics.md) |
|
||||
| tracking cookie set without consent | same; or GTM fires a tag without an `ad_storage` condition (analytics.md → GTM) |
|
||||
| GA hit with consent GRANTED | `setDefaultConsent` not before the tag — `<Analytics>` must be inside `<ConsentProvider>` (`SiteProviders` does this itself) |
|
||||
| YouTube / Maps before consent (warning) | `ConsentScript` (consent.md), `youtube-nocookie.com` or "click to load" |
|
||||
@@ -50,12 +50,12 @@ list in the panel and you check it:
|
||||
(Postgres), commit the migration. Embeds and widgets the plugin does not inject (YouTube, maps,
|
||||
chat): add them as `cookieScanner.declarations` (or an `integrations` entry with `isEnabled`) —
|
||||
never a hand-typed list in code.
|
||||
2. *Settings → Cookie review* → **Scan cookies**. "Integrations in use" must match the IDs in Site
|
||||
2. *Privacy → Cookie review* → **Scan cookies**. "Integrations in use" must match the IDs in Site
|
||||
Integrations; a filled ID that is missing → **ipal-debug**.
|
||||
3. Run the browser scan below and paste every cookie it reports as unknown into **More cookie
|
||||
names**, scan again. Entries with *Found by* = "Unknown — fill in" need provider, category and
|
||||
purpose: ask the client, do not guess.
|
||||
4. The editor accepts or rejects every draft (bulk edit works). Accepted → Cookie Settings →
|
||||
4. The editor accepts or rejects every draft (bulk edit works). Accepted → Cookie banner →
|
||||
Cookies, every language; existing text there is never overwritten. Open the banner's
|
||||
"Settings" and check each category lists its cookies.
|
||||
5. Database lookups come with category `functional` when the Open Cookie Database says
|
||||
@@ -70,15 +70,15 @@ When the project has `cookieScanner: { crawl: true }` (cookie-scanner.md → Bro
|
||||
`IPAL_COOKIE_SCAN_TOKEN` (`openssl rand -hex 32`) in Coolify; ask the team to add
|
||||
`<host>=<token>` to the scanner service's `IPAL_CRAWLER_SITES`; `generate:importmap`,
|
||||
`migrate:create cookie-crawl`. Never add Playwright or Chromium to the site.
|
||||
2. *Cookie review* → **Crawl site**. "Crawl site" disabled → the box names the missing variable.
|
||||
Failed → *Settings → Cookie crawl → Error* ("Could not reach the scanner service" = URL / DNS /
|
||||
2. *Cookie review* → **Check site**. "Check site" disabled → the box names the missing variable.
|
||||
Failed → *Privacy → Cookie check → Error* ("Could not reach the scanner service" = URL / DNS /
|
||||
firewall; a Cloudflare challenge page = allow the Coolify server's IP).
|
||||
3. Filter the list by **Violation**: every entry is a non-necessary cookie or key stored before
|
||||
consent — fix it as in the table above (or, if it really is necessary, set its category and accept
|
||||
it). *Cookie crawl → Violations* also lists tracker **requests** before consent.
|
||||
it). *Cookie check → Violations* also lists tracker **requests** before consent.
|
||||
4. Classify the new drafts (*Found by* = "Unknown — fill in"), then crawl again: 0 violations is
|
||||
the goal before handover.
|
||||
5. Optional: recipients in *Cookie crawl → E-mail warnings to*, and a weekly Coolify scheduled task
|
||||
5. Optional: recipients in *Cookie check → Warning e-mails to*, and a weekly Coolify scheduled task
|
||||
`curl -X POST -H "Authorization: Bearer $IPAL_COOKIE_SCAN_TOKEN" $NEXT_PUBLIC_SERVER_URL/api/ipal/cookie-crawl`.
|
||||
Record both in `AGENTS.md` → "Project decisions".
|
||||
|
||||
@@ -96,7 +96,7 @@ unknown names to the panel scan above instead of step 2):
|
||||
**non-necessary cookie set before consent** — fix it as in the table above. `[WARNING] unknown` —
|
||||
find the provider and purpose, set `category` (`necessary|functional|analytics|marketing`) and `purpose`
|
||||
in `cookies.json`. Do not guess — ask if you do not know.
|
||||
2. Import into the panel (Cookie Settings → Cookies), each language separately (scan with `--lang en` for English):
|
||||
2. Import into the panel (Cookie banner → Cookie list), each language separately (scan with `--lang en` for English):
|
||||
```bash
|
||||
LOCALE=pl pnpm payload run .agents/skills/ipal-consent-check/scripts/import-cookies.ts cookie-scan/cookies.json
|
||||
```
|
||||
@@ -104,18 +104,18 @@ unknown names to the panel scan above instead of step 2):
|
||||
the scan did not see — the editor does that in the panel. The same list feeds the
|
||||
`<CookieBanner settings="detailed">` window (an expandable list under each category) — after the import open
|
||||
"Settings" in the banner and check that every category shows its cookies and that the labels
|
||||
(Cookie Settings → Detail labels) are in that language.
|
||||
(Cookie banner → Settings window → Cookie list headings) are in that language.
|
||||
3. The cookie policy page shows the table from the panel — **do not paste the list into the policy text**:
|
||||
```tsx
|
||||
import { getCookieTable } from '@intecion/ipal-kit'
|
||||
import { CookieTable } from '@intecion/ipal-kit/rsc'
|
||||
import { getCachedPayload, getSiteShell } from '@/lib/content'
|
||||
const rows = await getCookieTable({ payload: await getCachedPayload(), locale })
|
||||
const { consent } = await getSiteShell(locale) // category names from Cookie Settings
|
||||
const { consent } = await getSiteShell(locale) // category names from Cookie banner
|
||||
<CookieTable rows={rows} categories={consent.categories} labels={labels} />
|
||||
```
|
||||
`labels` = `{ name, category, provider, purpose, duration }` (all required). The plugin panel
|
||||
has only `provider` / `purpose` / `duration` (Cookie Settings → Detail labels = `consent.details`);
|
||||
has only `provider` / `purpose` / `duration` (Cookie banner → Settings window → Cookie list headings = `consent.details`);
|
||||
take the `name` and `category` headers from (localized) fields of the project block. The table is unstyled
|
||||
(`classNames`: `table`, `caption`, `tr`, `th`, `td`; optional `caption`). A project "Cookie
|
||||
table" block on the policy page is a good place — then the editor decides where it appears.
|
||||
|
||||
@@ -56,12 +56,12 @@ through this procedure. Ask only when you are missing something you cannot get y
|
||||
| empty SEO tab, no Forms | mismatched `@payloadcms/*` versions | all `@payloadcms/*` = the `payload` version |
|
||||
| upload rejected "Image is … Tick Optimize" | `buildOptimizeUploadHook` (intended) | tick the checkbox or prepare the file; limit in the hook options |
|
||||
| video upload rejected | `maxVideoBytes` limit | export as the message says (H.264, 720–1080p, fast start) |
|
||||
| change in the panel not visible | no Save / ISR without revalidation | collection: `buildRevalidateHook`; your own global (Header, Footer…): `afterChange: [buildGlobalRevalidateHook({ revalidatePath })]` (ipal-nav); the plugin's globals (Site Settings, Site Integrations, Cookie Settings, Notifications): pass `ipalKit({ revalidatePath })` (from `next/cache`) — without it the change waits until the `revalidate` window ends |
|
||||
| change in the panel not visible | no Save / ISR without revalidation | collection: `buildRevalidateHook`; your own global (Header, Footer…): `afterChange: [buildGlobalRevalidateHook({ revalidatePath })]` (ipal-nav); the plugin's globals (Site settings, Site integrations, Cookie banner, Notifications): pass `ipalKit({ revalidatePath })` (from `next/cache`) — without it the change waits until the `revalidate` window ends |
|
||||
|
||||
### Front end / routing / SEO
|
||||
| Symptom | Cause | Fix |
|
||||
|---|---|---|
|
||||
| `/pl` → 404 | Homepage not assigned in System Pages | set it in the panel |
|
||||
| `/pl` → 404 | Homepage not assigned in System pages | set it in the panel |
|
||||
| `/en/*` → 404, `/pl/*` works | slug/title missing in EN | `ipal-locale-add` → `locale-coverage` |
|
||||
| language switcher → 404 | prefix swap instead of `AlternateLinksUpdater` | i18n.md → AlternateLinks |
|
||||
| metadata in `<body>` (seo-check) | streaming: no `htmlLimitedBots`, explicit `<head>`, dynamic page | AGENT §4; `generatePageMetadata` |
|
||||
|
||||
@@ -58,7 +58,7 @@ checkbox, **Checkbox group** (multiple choice, min/max), message, **Step** (spli
|
||||
country, state (on by default in form-builder, rendered as a text field).
|
||||
Turning a type off: `forms.fields: { country: false, state: false }`.
|
||||
- **Multi-step form:** the editor inserts a **Step** block (title, description) — the fields below it form one
|
||||
screen. The Next/Back buttons and "Step 1 of 3" come from **Notifications → Form messages** (next, back,
|
||||
screen. The Next/Back buttons and "Step 1 of 3" come from **Form messages → Form messages** (next, back,
|
||||
stepOf). Next validates only the current step; a server error returns to the step with the field; focus
|
||||
moves to the new step. No Step = one screen.
|
||||
- `width` ≤ 50 → class `fieldHalf`, otherwise `fieldFull`.
|
||||
@@ -121,8 +121,8 @@ Details the seed already covers, which you check after every manual change in th
|
||||
body `{{*:table}}`) **and** confirmation to the sender (`emailTo: {{email}}`) — both mandatory.
|
||||
The email field must have `name: 'email'` (the plugin accepts exactly one address in it).
|
||||
5. **Analytics (GTM / dataLayer)**: Event name `generate_lead` / `form_submit`, parameters `form_name`.
|
||||
6. **Site Integrations**: mail transport (SMTP/Graph) + **Send test**; Turnstile keys.
|
||||
7. **Notifications → form.\***: texts in every language.
|
||||
6. **Site integrations**: mail transport (SMTP/Graph) + **Send test**; Turnstile keys.
|
||||
7. **Form messages → form.\***: texts in every language.
|
||||
|
||||
## 6. Check it yourself before you say "done"
|
||||
- [ ] submitting with empty required fields → errors at the fields, no request;
|
||||
@@ -132,7 +132,7 @@ Details the seed already covers, which you check after every manual change in th
|
||||
- [ ] unticked consent → a message from Notifications (not the English fallback);
|
||||
- [ ] 6 quick submissions → `rate_limited`;
|
||||
- [ ] Turnstile with keys → widget visible; submitting without solving the widget → `turnstile`;
|
||||
wrong secret → the form goes through, and the panel (dashboard + Site Integrations → Turnstile) shows a red alert;
|
||||
wrong secret → the form goes through, and the panel (dashboard + Site integrations → Turnstile) shows a red alert;
|
||||
- [ ] Turnstile without keys → no widget, the form goes through;
|
||||
- [ ] second language → labels and messages in that language;
|
||||
- [ ] GTM Preview → an event with the name from the panel after success;
|
||||
@@ -146,7 +146,7 @@ Details the seed already covers, which you check after every manual change in th
|
||||
| no Forms collection in the panel | form-builder vs payload version mismatch → same version, `pnpm.overrides` |
|
||||
| the block renders nothing | `form` is an ID (`depth` too low) or `formTexts`/`sendForm` missing in enhanceProps |
|
||||
| `reason: 'validation'`, `kind: 'unknown_fields'` | the frontend sends a field the form does not have (custom renderer with an extra field, typo in `name`) |
|
||||
| "Next/Back" buttons in English | empty Notifications → Form messages → next / back / stepOf in that language |
|
||||
| "Next/Back" buttons in English | empty Form messages → next / back / stepOf in that language |
|
||||
| `reason: 'not_found'` | `formId` from another database (seeded on dev, another ID on prod) — use a relationship from the panel, not a fixed ID in code |
|
||||
| submission exists, no email | missing `email: mailAdapter()`, empty Emails tab, transport in the panel; server logs |
|
||||
| always `turnstile` | wrong key pair / domain in Cloudflare (BuilderForm resets the token after an error) |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: ipal-locale-add
|
||||
description: Adds a new language to an ipal-kit site (or turns a single-language site into a multilingual one) end to end — i18n.config, routing, Postgres migration, slugs and titles per page, globals (Header, Footer, Site Settings, Cookie Settings, Notifications), forms, SEO (hreflang, sitemap), language switcher — and proves completeness with a coverage script and ipal-seo-check. Use when the user asks for a new language/locale/translation version of the site.
|
||||
description: Adds a new language to an ipal-kit site (or turns a single-language site into a multilingual one) end to end — i18n.config, routing, Postgres migration, slugs and titles per page, globals (Header, Footer, Site settings, Cookie banner, Notifications), forms, SEO (hreflang, sitemap), language switcher — and proves completeness with a coverage script and ipal-seo-check. Use when the user asks for a new language/locale/translation version of the site.
|
||||
---
|
||||
|
||||
# ipal-locale-add
|
||||
@@ -50,17 +50,17 @@ Fill them in this order (panel or a Local API script with `locale: 'de'`):
|
||||
| What | Where | Effect if missing |
|
||||
|---|---|---|
|
||||
| slug + title of every page | Pages (and other collections with a URL) | 404 in the new language |
|
||||
| Homepage/404/policy | System Pages (shared relations) + their slug in `de` | `/de` → 404, empty policy link |
|
||||
| Homepage/404/policy | System pages (shared relations) + their slug in `de` | `/de` → 404, empty policy link |
|
||||
| Header / Footer — link labels | navigation globals | empty menu items |
|
||||
| Site Settings — name, description, OG | Site Settings | title/OG from the fallback |
|
||||
| Cookie Settings — all texts + `privacyLinkLabel`, Detail labels, Cookies (`purpose`, `duration`) | Cookie Settings | banner / `detailed` window in another language (GDPR: consent must be understandable); scan + import with `--lang <code>` (ipal-consent-check) |
|
||||
| Site settings — name, description, OG | Site settings | title/OG from the fallback |
|
||||
| Cookie banner — all texts + `privacyLinkLabel`, Detail labels, Cookies (`purpose`, `duration`) | Cookie banner | banner / `detailed` window in another language (GDPR: consent must be understandable); scan + import with `--lang <code>` (ipal-consent-check) |
|
||||
| Notifications — `form.*` | Notifications | form messages from the English fallback |
|
||||
| Forms — field labels, confirmation, Emails | Forms (every form) | form in the wrong language |
|
||||
| SEO tab — meta title/description | every page | duplicates/gaps in seo-check |
|
||||
| Media — `alt` (if localized) | Media | a11y |
|
||||
|
||||
Slugs in the new language: words in that language, lowercase, no diacritics
|
||||
(`ueber-uns`, not `über-uns`). The home page is the page assigned in System Pages → Homepage —
|
||||
(`ueber-uns`, not `über-uns`). The home page is the page assigned in System pages → Homepage —
|
||||
fill in its slug in `de` like any page (coverage checks it), but its address is always `/de`.
|
||||
When writing through the Local API: `payload.update({ collection, id, locale: 'de', fallbackLocale: false, data })`:
|
||||
- **`fallbackLocale: false` is mandatory** — without it (with `fallback: true`) Payload
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: ipal-nav
|
||||
description: Builds the site header, footer, mobile menu and company data in an ipal-kit project — Header/Footer/Company globals with buildLinkField from the plugin, server-side link resolution (resolveNav from the plugin), a small client MobileNav, legal links from System Pages, revalidation on change. Use when creating or changing navigation, menu, header, footer, contact details, social links or the company global.
|
||||
description: Builds the site header, footer, mobile menu and company data in an ipal-kit project — Header/Footer/Company globals with buildLinkField from the plugin, server-side link resolution (resolveNav from the plugin), a small client MobileNav, legal links from System pages, revalidation on change. Use when creating or changing navigation, menu, header, footer, contact details, social links or the company global.
|
||||
---
|
||||
|
||||
# ipal-nav
|
||||
@@ -27,9 +27,9 @@ Requires the UI primitives from `../ipal-block/resources/section-code.md` (like
|
||||
Do not create `lib/navigation.ts`.
|
||||
4. `src/components/layout/Header.tsx`, `Footer.tsx` (server), `MobileNav.tsx`
|
||||
(`'use client'`, open state only, data via props, `import type { NavItem } from '@intecion/ipal-kit'`).
|
||||
5. **Legal links in the footer** from the System Pages roles: `getSystemLinks(locale)` (href + page
|
||||
5. **Legal links in the footer** from the System pages roles: `getSystemLinks(locale)` (href + page
|
||||
title) — not as manual items. Copyright year from code, name from `Company`.
|
||||
6. Logo from Site Settings via `<Media>` — do not duplicate the field in Header.
|
||||
6. Logo from Site settings via `<Media>` — do not duplicate the field in Header.
|
||||
7. Wire it in `src/app/(frontend)/[locale]/layout.tsx` (fetch the globals through
|
||||
cached getters in `lib/`, pass them as props).
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
Navigation, footer and company data are **project globals** (the model depends on the client
|
||||
and the country), built from the same shared fields as sections. Logo and name live in
|
||||
Site Settings — do not duplicate them in Header.
|
||||
Site settings — do not duplicate them in Header.
|
||||
|
||||
```ts
|
||||
// src/globals/Header.ts
|
||||
@@ -79,7 +79,7 @@ export const Footer: GlobalConfig = {
|
||||
```
|
||||
|
||||
- **Legal links in the footer** (privacy policy, cookies, terms): `await getSystemLinks(locale)` from `lib/content`
|
||||
— href and label (page title) from System Pages; do not add them by hand to `columns`, do not write labels in code.
|
||||
— href and label (page title) from System pages; do not add them by hand to `columns`, do not write labels in code.
|
||||
- Highlighted menu item / button in a different colour = a style in the admin panel:
|
||||
`buildLinkField({ appearances: ['default', { label: 'Highlighted', value: 'highlight' }] })` → a class in the project.
|
||||
- **Company data** (name, address, NIP/ABN, phone) — the project's `company` global;
|
||||
@@ -117,7 +117,7 @@ export async function Header({ header, locale }: { header: HeaderData; locale: s
|
||||
return (
|
||||
<header className="border-b">
|
||||
<nav className="container flex items-center justify-between py-4">
|
||||
{/* logo: Site Settings → <Media> */}
|
||||
{/* logo: Site settings → <Media> */}
|
||||
<ul className="hidden gap-6 md:flex">
|
||||
{items.map((item) => (
|
||||
<li key={item.href}>
|
||||
|
||||
@@ -22,7 +22,8 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| `i18n.defaultLocale` | — | `localization.defaultLocale`, `/` redirect in the proxy | must be in `locales` |
|
||||
| `i18n.fallback` | `true` | `localization.fallback` | `false` |
|
||||
| `i18n.locales[]` `{ code, label, rtl? }` | — | list of languages (min. 1); `rtl: true` → `rtl` in Payload | adding a language: skill **ipal-locale-add** |
|
||||
| `access` | none | `roles` field (`user` < `editor` < `admin`, `saveToJWT`) in the auth collection | omit → **no roles**: every logged-in account passes the plugin's admin/editor checks (`userMeetsRole`): Site Integrations, the e-mail test, stats, consent-records, settings globals, `form-submissions`. Narrow them with `globalOverrides` / collection overrides |
|
||||
| admin languages (no option) | English + Polish | `i18n.supportedLanguages` set to `{ en, pl }` when the project has none; plugin component texts in `i18n.translations.<lang>.ipal` (`adminTexts`); every plugin label is `{ en, pl }` (rules: `docs/dev/admin-ux.md`) | your own `i18n.supportedLanguages` wins; override a component text with `i18n.translations.<lang>.ipal.<key>`; field/global labels via `globalOverrides` / `collectionOverrides` — see i18n.md "Admin panel languages and texts" |
|
||||
| `access` | none | `roles` field (`user` < `editor` < `admin`, `saveToJWT`) in the auth collection | omit → **no roles**: every logged-in account passes the plugin's admin/editor checks (`userMeetsRole`): Site integrations, the e-mail test, stats, consent-records, settings globals, `form-submissions`. Narrow them with `globalOverrides` / collection overrides |
|
||||
| `access.authCollection` | — (required in `access`) | collection that gets `roles`; also the slug of the injected auth collection | your own collection with that slug wins |
|
||||
| `access.defaultRole` | `'user'` | `defaultValue` of the `roles` field | `'editor'` / `'admin'` |
|
||||
| `access.authAccess` | `{ create: adminOnly, delete: adminOnly, read: adminOrSelf, unlock: adminOnly, update: adminOrSelf }` | access of the auth collection the plugin **injects** (Payload's default lets any logged-in account edit or delete every other account) | your keys win, e.g. `{ read: authenticated }`; your own collection with that slug wins whole (give it `adminOrSelf` / `adminOnly` yourself) |
|
||||
@@ -33,15 +34,15 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| `twoFactor.plugin` | — (required) | injected `payloadTotp` (the plugin does not import the peer) | missing function → throws |
|
||||
| `twoFactor.collectionSlug` | the panel's login collection (`admin.user`, else the first auth collection) | collection with 2FA; startup fails with `[ipal] twoFactor…` when it is not an auth collection or differs from `admin.user` | point it at the login collection |
|
||||
| `twoFactor.allowCollectionMismatch` | `false` | allows `collectionSlug` ≠ `admin.user` (panel users of the other collection then skip 2FA) | `true` only when you protect a second auth collection on purpose |
|
||||
| `whiteLabel` | none | `admin.components.graphics.Logo/Icon` (`AdminLogo`/`AdminIcon`) from Site Settings + vendor credit | omit / `false`; `true` = defaults |
|
||||
| `whiteLabel` | none | `admin.components.graphics.Logo/Icon` (`AdminLogo`/`AdminIcon`) from Site settings + vendor credit | omit / `false`; `true` = defaults |
|
||||
| `whiteLabel.settingsSlug` | `'site-settings'` | global it reads the logo/name from | — |
|
||||
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site Settings | any upload/text field |
|
||||
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site settings | any upload/text field |
|
||||
| `whiteLabel.titleSuffix` | none | `admin.meta.titleSuffix` (tab title) | — |
|
||||
| `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks` | `false`; `{ text, url }` overrides |
|
||||
| `pages` | none | Site Settings → **System Pages** (page roles) and **Under construction** tabs | omit → neither tab |
|
||||
| `pages.slug` | — (required in `pages`) | the project's pages collection (System Pages relations, construction, IndexNow) | — |
|
||||
| `pages` | none | Site settings → **System pages** (page roles) and **Maintenance** tabs | omit → neither tab |
|
||||
| `pages.slug` | — (required in `pages`) | the project's pages collection (System pages relations, construction, IndexNow) | — |
|
||||
| `pages.roles` | all: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` | which assignments to show | subset of the array |
|
||||
| `content` | none | `<slug>Archive` field in System Pages per collection (entry URL = archive page slug) | **ignored without `pages`** (no archive fields; IndexNow still works) |
|
||||
| `content` | none | `<slug>Archive` field in System pages per collection (entry URL = archive page slug) | **ignored without `pages`** (no archive fields; IndexNow still works) |
|
||||
| `content.collections[]` `{ slug, label?, perPage? }` | `label` = slug, `perPage` 10 | archive entry; the same value goes to `createContentHelpers({ content })` | the project creates the collection (skill **ipal-collection**) |
|
||||
| `seo` | none | `@payloadcms/plugin-seo` (`meta` group + `titleOverride`), Content/SEO tabs, auto-fill hook | omit |
|
||||
| `seo.collections` | — (required) | collections with `meta` | — |
|
||||
@@ -50,7 +51,7 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| `seo.fields` | `[]` | extra fields in the SEO group | — |
|
||||
| `seo.uploadsCollection` | `'media'` | upload collection `meta.image` relates to | any upload collection slug |
|
||||
| `seo.generateTitle` / `generateDescription` | plugin-seo | preview / generation in the panel | your own function `({ doc }) => string` |
|
||||
| `seo.searchSettings` | tab on (the tab exists with or without `seo`) | Site Settings → **Search & AI** tab: `searchVerification.google/bing/yandex` (→ `<meta>` via `generatePageMetadata`), `aiCrawlers.policy` + `aiCrawlers.rules[]` (→ robots.txt via `getRobots`), localized `llmsIntro` (→ top of `/llms.txt`); empty fields change nothing. Postgres: `migrate:create` after upgrading | `false` = no tab, but this key exists only inside `seo` (which needs `collections`); without `seo` use the top-level `searchSettings: false`. When both are set, the top-level `searchSettings` wins; `(fields) => fields` = your own set (keep the names `searchVerification`, `aiCrawlers`, `llmsIntro` or read your own fields in your routes) |
|
||||
| `seo.searchSettings` | tab on (the tab exists with or without `seo`) | Site settings → **Search engines** tab: `searchVerification.google/bing/yandex` (→ `<meta>` via `generatePageMetadata`), `aiCrawlers.policy` + `aiCrawlers.rules[]` (→ robots.txt via `getRobots`), localized `llmsIntro` (→ top of `/llms.txt`); empty fields change nothing. Postgres: `migrate:create` after upgrading | `false` = no tab, but this key exists only inside `seo` (which needs `collections`); without `seo` use the top-level `searchSettings: false`. When both are set, the top-level `searchSettings` wins; `(fields) => fields` = your own set (keep the names `searchVerification`, `aiCrawlers`, `llmsIntro` or read your own fields in your routes) |
|
||||
| `searchSettings` | tab on | same tab and values as `seo.searchSettings`, but a top-level option: works **with or without `seo`**; read as `searchSettings ?? seo.searchSettings`, so it wins when both are set | `false` = no tab; `(fields) => fields` = your own set |
|
||||
| — (no option) | `uploadsCollection: 'media'` | meta image from the `media` collection | currently always `media` (gap) |
|
||||
| `forms` | none | `@payloadcms/plugin-form-builder`: `forms`, `form-submissions` collections | omit |
|
||||
@@ -59,25 +60,25 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| `forms.formOverrides` | Form/Forms labels, `emails` readable by logged-in users only | overrides the `forms` collection (`fields: ({ defaultFields }) => …`, `slug`, `admin`, `access`…) | any `CollectionConfig` |
|
||||
| `forms.formSubmissionOverrides` | create: logged-in, read: editor+, delete: admin | overrides `form-submissions` | `access.create` etc. wins |
|
||||
| `forms.redirectRelationships` | none | collections a form can redirect to | `['pages']` |
|
||||
| `forms.emailLayout` | `false` | `beforeEmail` with a layout (logo, colour, footer) + Site Settings → **Emails** tab; `{{*:table}}` readable | `true` |
|
||||
| `forms.emailLayout` | `false` | `beforeEmail` with a layout (logo, colour, footer) + Site settings → **Emails** tab; `{{*:table}}` readable | `true` |
|
||||
| `forms.beforeEmail` | none | your own e-mail changes (after the layout) | form-builder function |
|
||||
| `forms.consentFieldName` | `'consent'` | name of the GDPR consent field `submitForm` requires (read from `config.custom.ipal`) | `createSubmitAction({ consentFieldName })` / `submitForm` argument wins |
|
||||
| `consentLog` | off | `consent-records` collection + `POST /api/ipal/consent` (rate limit 20/min) | `true` / `{ retentionDays }` (default 1095) |
|
||||
| `consentLog.collectionOverrides` | none | changes `consent-records`: an object merges `access` / `admin` / `hooks` key by key (your keys win), a function `(collection) => collection` takes over (keep the slug) | e.g. `{ access: { read: ({ req }) => req.user?.email === '[email protected]' } }` — narrows who reads records in a project without roles |
|
||||
| `cookieScanner` | off | `cookie-review` collection (drafts an editor accepts → Cookie Settings → Cookies), "Scan cookies" box above its list (`CookieScanButton`), `GET`/`POST /api/ipal/cookie-scan`; a scan lists the cookies of the integrations switched on + names looked up in the bundled Open Cookie Database; never deletes, never overwrites edited text, never publishes by itself | `true` / object; after switching on: `pnpm generate:importmap` + `migrate:create`. Check: *Settings → Cookie review* → **Scan cookies** → drafts appear; set one to Accepted → it is in Cookie Settings → Cookies (cookie-scanner.md) |
|
||||
| `cookieScanner` | off | `cookie-review` collection (drafts an editor accepts → Cookie banner → Cookie list), "Scan cookies" box above its list (`CookieScanButton`), `GET`/`POST /api/ipal/cookie-scan`; a scan lists the cookies of the integrations switched on + names looked up in the bundled Open Cookie Database; never deletes, never overwrites edited text, never publishes by itself | `true` / object; after switching on: `pnpm generate:importmap` + `migrate:create`. Check: *Privacy → Cookie review* → **Scan cookies** → drafts appear; set one to Accepted → it is in Cookie banner → Cookie list (cookie-scanner.md) |
|
||||
| `cookieScanner.declarations` / `.integrations` | built-ins only | the project's own cookies (`CookieDeclaration[]`), or `(defaults) => CookieIntegration[]` to add / change / drop integrations (`key`, `label`, `declarations`, `isEnabled(ctx)`) | e.g. a chat widget on when `ctx.integrations.chatId` is filled |
|
||||
| `cookieScanner.access` / `.collectionOverrides` / `.labels` | editor+ / none / `en` + `pl` | who may scan; changes `cookie-review` like `consentLog.collectionOverrides`; admin labels per language (`CookieScanLabels`) | object or function |
|
||||
| `cookieScanner.crawl` | off | browser pre-consent check through the shared scanner service (`services/cookie-crawler`, Coolify): **Crawl site** in the review box, `cookie-crawl` global (latest result only), `GET`/`POST /api/ipal/cookie-crawl`, `POST /api/ipal/cookie-crawl/results` (token), `violation` / `violationDetail` / `seenBeforeConsent` on `cookie-review`, `CookieCrawlAlert` on the dashboard, e-mail to *Cookie crawl → E-mail warnings to* | `true` / `CookieCrawlOptions`; env `IPAL_COOKIE_SCAN_URL` + `IPAL_COOKIE_SCAN_TOKEN`; `generate:importmap` + `migrate:create`. Check: the review box's **Crawl site** is enabled → click → "Last crawl …" with counts; `curl -X POST -H "Authorization: Bearer $IPAL_COOKIE_SCAN_TOKEN" $U/api/ipal/cookie-crawl` → 202 |
|
||||
| `cookieScanner.crawl` | off | browser pre-consent check through the shared scanner service (`services/cookie-crawler`, Coolify): **Check site** in the review box, `cookie-crawl` global (latest result only), `GET`/`POST /api/ipal/cookie-crawl`, `POST /api/ipal/cookie-crawl/results` (token), `violation` / `violationDetail` / `seenBeforeConsent` on `cookie-review`, `CookieCrawlAlert` on the dashboard, e-mail to *Cookie check → Warning e-mails to* | `true` / `CookieCrawlOptions`; env `IPAL_COOKIE_SCAN_URL` + `IPAL_COOKIE_SCAN_TOKEN`; `generate:importmap` + `migrate:create`. Check: the review box's **Check site** is enabled → click → "Last crawl …" with counts; `curl -X POST -H "Authorization: Bearer $IPAL_COOKIE_SCAN_TOKEN" $U/api/ipal/cookie-crawl` → 202 |
|
||||
| `cookieScanner.crawl.serviceUrl` / `.token` / `.siteUrl` / `.maxPages` / `.acceptSelector` | env URL / env token / `serverURL` → `NEXT_PUBLIC_SERVER_URL` / `20` / `[data-ipal="accept"]` | where the service is, the shared secret, the public origin crawled and called back, pages from the sitemap (max 100), the banner's accept button | options win over env |
|
||||
| `cookieScanner.crawl.consentMode` / `.trackerHosts` / `.dashboard` / `.globalOverride` | `'advanced'` / `DEFAULT_TRACKER_HOSTS` / `true` / none | `'basic'` also flags Google tag requests before consent; hosts counted as trackers; dashboard warning; changes the `cookie-crawl` global like `globalOverrides` | `(defaults) => [...defaults, 'chat.example']`; `dashboard: false` |
|
||||
| `cookieScanner.database` / `.databaseCategories` / `.syncAccepted` | `true` / Functional+Personalization → functional, Security+Necessary → necessary / `true` | Open Cookie Database lookup on or off; category map; accepting writes to Cookie Settings | `database: false`; `{ Functional: 'necessary' }`; `syncAccepted: false` |
|
||||
| `cookieScanner.database` / `.databaseCategories` / `.syncAccepted` | `true` / Functional+Personalization → functional, Security+Necessary → necessary / `true` | Open Cookie Database lookup on or off; category map; accepting writes to Cookie banner | `database: false`; `{ Functional: 'necessary' }`; `syncAccepted: false` |
|
||||
| `stats` | off | `stats-visits` collection, `POST /api/ipal/hit`, `/<admin>/stats` view, nav link, dashboard chart | `true` / object |
|
||||
| `stats.collectionOverrides` | none | changes `stats-visits` like `consentLog.collectionOverrides`; its `access.read` also decides who sees the stats view and dashboard chart | object or function |
|
||||
| `stats.retentionDays` / `timeZone` / `dashboard` | 90 / `'Europe/Warsaw'` / `true` | retention, day boundary, `StatsWidget` | `dashboard: false` hides the chart |
|
||||
| `indexNow` | `false` | `afterChange` hook (publish → IndexNow, production + https only) in the `pages.slug ?? 'pages'` collection and each one from `content` | `true` + `indexnow-key.txt` route |
|
||||
| `lightbox` | `false` | **Lightbox** group in the Notifications global (image viewer labels: open, dialog, previous, next, close, counter — localized); read by `getNotificationTexts(...).lightbox` / `getSiteShell().lightboxTexts`. Postgres: `migrate:create` | omit = English fallbacks + the `texts` prop; `lightboxNotificationFields` for your own global; `globalOverrides.notifications` |
|
||||
| `siteSettingsFields` | none | **Custom** tab in Site Settings | `Field[]` |
|
||||
| `integrationsFields` | none | **Custom** tab in Site Integrations | `Field[]` |
|
||||
| `lightbox` | `false` | **Image viewer** group in the Form messages global (`notifications`) (image viewer labels: open, dialog, previous, next, close, counter — localized); read by `getNotificationTexts(...).lightbox` / `getSiteShell().lightboxTexts`. Postgres: `migrate:create` | omit = English fallbacks + the `texts` prop; `lightboxNotificationFields` for your own global; `globalOverrides.notifications` |
|
||||
| `siteSettingsFields` | none | **Custom** tab in Site settings | `Field[]` |
|
||||
| `integrationsFields` | none | **Custom** tab in Site integrations | `Field[]` |
|
||||
| `globalOverrides` | none | changes the plugin's globals (`site-settings`, `site-integrations`, `cookie-settings`, `notifications`): an object merges `access` / `admin` / `hooks` key by key (your keys win, your hooks run after the plugin's), other keys replace; a function `(global) => global` takes over | e.g. `{ notifications: { access: { update: authenticated } } }`; the way to change the plugin globals' access or hooks |
|
||||
| `revalidatePath` | none | `revalidatePath` from `next/cache` (injected): saving any plugin global revalidates the whole layout (`buildGlobalRevalidateHook`) | omit = globals change after the ISR window; once: `context: { disableRevalidate: true }` |
|
||||
| `enabled` | `true` | `false` → collections, globals and fields stay (schema and migrations unchanged), but no plugin endpoints (`/api/ipal/*`), no `onInit` work and no admin components; `i18n` is validated anyway | `false`; check: `payload migrate:create` after switching produces no DROP TABLE |
|
||||
@@ -92,8 +93,8 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| global `cookie-crawl` | latest browser crawl (status, counts, violations, third-party hosts) + e-mail recipients; read editor+, update admin | `cookieScanner.crawl` (`globalOverride`) | off by default |
|
||||
| `cookie-review` | cookie scanner drafts (`status` draft / accepted / rejected; create/read/update editor+, delete admin) | `cookieScanner` | off by default |
|
||||
| `stats-visits` | visits without IP (admin reads/deletes; `stats.collectionOverrides`) | `stats` | off by default |
|
||||
| global `site-settings` | General, Theme, [System Pages], [Emails], [Under construction], Search & AI, [Custom]; public read, write editor+ | `pages`, `content`, `forms.emailLayout`, `searchSettings` / `seo.searchSettings`, `siteSettingsFields` | always present; access/hooks/fields: `globalOverrides` |
|
||||
| global `site-integrations` | Analytics, Turnstile, SMTP, IndexNow, [Custom]; admin only | `integrationsFields` | always present; `globalOverrides` |
|
||||
| global `site-settings` | General, Theme, [System pages], [E-mails], [Maintenance], Search engines, [More]; public read, write editor+ | `pages`, `content`, `forms.emailLayout`, `searchSettings` / `seo.searchSettings`, `siteSettingsFields` | always present; access/hooks/fields: `globalOverrides` |
|
||||
| global `site-integrations` | Analytics, Turnstile, SMTP, IndexNow, [More]; admin only | `integrationsFields` | always present; `globalOverrides` |
|
||||
| global `cookie-settings` | banner texts, categories, cookie list; public read, write editor+ | `globalOverrides` | always present; `globalOverrides` |
|
||||
| global `notifications` | form messages per language; public read, write editor+ | `globalOverrides` | always present; `globalOverrides` |
|
||||
| global revalidation hook | `afterChange` on the four globals → `revalidatePath('/', 'layout')` | `revalidatePath` | omit `revalidatePath` |
|
||||
@@ -106,7 +107,7 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| `routes.admin` | from `adminRoute` | `adminRoute` | — |
|
||||
| `beforeChange` meta auto-fill hook | in `seo.collections` | `seo.autoFill` | `autoFill: false` |
|
||||
| `afterChange` IndexNow hook | pages + content | `indexNow` | off by default |
|
||||
| `onInit` | Cookie Settings button migration + log `[ipal] Plugin initialized.` (your `onInit` runs first) | — | **currently always** |
|
||||
| `onInit` | Cookie banner button migration + log `[ipal] Plugin initialized.` (your `onInit` runs first) | — | **currently always** |
|
||||
|
||||
**Import map** (`@intecion/ipal-kit/admin#…`) — after every option change: `pnpm generate:importmap`
|
||||
(`pnpm payload generate:importmap`), otherwise the panel is blank / a component is missing.
|
||||
@@ -116,14 +117,14 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
| `AdminLogo`, `AdminIcon` | `graphics.Logo/Icon` | `whiteLabel` |
|
||||
| `IntecionCredit` | `afterLogin`, `afterNavLinks` | `whiteLabel` and `credit !== false` |
|
||||
| `StatsNavLink`, `StatsView` (`views.ipalStats`, `/stats`), `StatsWidget` (`beforeDashboard`) | nav, view, dashboard | `stats` (`dashboard: false` without the widget) |
|
||||
| `CookieScanButton` | `beforeListTable` of `cookie-review` (with **Crawl site** when `crawl` is on) | `cookieScanner` |
|
||||
| `CookieScanButton` | `beforeListTable` of `cookie-review` (with **Check site** when `crawl` is on) | `cookieScanner` |
|
||||
| `CookieCrawlAlert` | `beforeDashboard` | `cookieScanner.crawl` and `dashboard !== false` |
|
||||
| `IntegrationAlerts` | `beforeDashboard` | **currently always** (renders nothing when everything works) |
|
||||
| `IntegrationStatusBanner` | UI field in the Site Integrations tabs | always (with the global) |
|
||||
| `IntegrationStatusBanner` | UI field in the Site integrations tabs | always (with the global) |
|
||||
| `MaskedField` | SMTP / Turnstile secrets | always |
|
||||
| `TestEmailButton` | Site Integrations → SMTP | always |
|
||||
| `TestEmailButton` | Site integrations → SMTP | always |
|
||||
| `MetaDescriptionCheck` | below `meta.description` | `seo` and `descriptionCheck !== false` |
|
||||
| `RowLabel` | array row labels | only when the project uses `rowLabel(...)` (admin-ui) |
|
||||
| `RowLabel` | array row labels (Cookie banner categories and cookie list; your own `rowLabel(...)`) | always |
|
||||
|
||||
## 3. What the project wires itself
|
||||
|
||||
@@ -143,9 +144,9 @@ Mandatory set: AGENT.md §0b, skill **ipal-setup**; checks: **ipal-audit**, **ip
|
||||
| layout | `app/(frontend)/[locale]/layout.tsx` | `const shell = await getSiteShell(locale)`; `<SiteProviders shell={shell} logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />} theme stats>` | HTML: `<script type="application/ld+json">` (WebSite+Organization), cookie banner | frontend.md, consent.md |
|
||||
| theme | layout | `<SiteProviders theme>` (or `<ThemeScript {...shell.theme} />` from `/rsc`), `<html suppressHydrationWarning>`; switcher `<ThemeSwitcher>` (`/client`) | `data-theme` on `<html>` before hydration | theme.md |
|
||||
| catch-all | `app/(frontend)/[locale]/[[...slug]]/page.tsx` | `export const revalidate = 3600`; `const route = createPageRoute(content, { blocks, notFound, permanentRedirect, blockProps })`; `export default route.Page`; `generateMetadata`, `generateStaticParams` | `curl -s $U/pl/<slug>` 200; change the slug → the old one gives 308 | frontend.md, pages.md |
|
||||
| 404 | `[locale]/not-found.tsx` + `notFoundView.ts` | `export default createNotFoundPage(content, { load: loadNotFoundView })`; `'use server'` `renderNotFoundView(content, { blocks }, locale)` | `curl -sI $U/pl/xyz` → 404 with content from System Pages | pages.md |
|
||||
| 404 | `[locale]/not-found.tsx` + `notFoundView.ts` | `export default createNotFoundPage(content, { load: loadNotFoundView })`; `'use server'` `renderNotFoundView(content, { blocks }, locale)` | `curl -sI $U/pl/xyz` → 404 with content from System pages | pages.md |
|
||||
| sitemap | `app/sitemap.xml/route.ts` | `export { sitemapRoute as GET } from '@/lib/content'` + `dynamic = 'force-dynamic'` (or `sitemap.ts` with `sitemap` — never both; only `sitemapRoute` splits a large site into a `<sitemapindex>` with `?part=N` parts above 10 000 URLs) | `curl -s $U/sitemap.xml` (hreflang, XSL style); `curl -sI` → `Cache-Control: public, max-age=0, s-maxage=3600…`; a database error → 503 + `Retry-After` | seo.md |
|
||||
| robots | `app/robots.ts` | `export { getRobots as default } from '@/lib/content'` + `force-dynamic` (AI crawler policy from Site Settings → Search & AI); `robots` (sync) ignores the panel | `curl -s $U/robots.txt` (Sitemap:, AI bots, `User-agent` groups from the panel) | seo.md |
|
||||
| robots | `app/robots.ts` | `export { getRobots as default } from '@/lib/content'` + `force-dynamic` (AI crawler policy from Site settings → Search engines); `robots` (sync) ignores the panel | `curl -s $U/robots.txt` (Sitemap:, AI bots, `User-agent` groups from the panel) | seo.md |
|
||||
| manifest | `app/manifest.ts` | `export { manifest as default }` + `force-dynamic` | `curl -s $U/manifest.webmanifest` | seo.md |
|
||||
| llms | `app/llms.txt/route.ts`, `app/llms-full.txt/route.ts` | `export { llmsRoute as GET }` / `llmsFullRoute` + `force-dynamic` | `curl -s $U/llms.txt` | seo.md |
|
||||
| Markdown | `app/md/[locale]/[[...slug]]/route.ts` | `export { markdownRoute as GET }` + `force-dynamic` | `curl -s $U/md/pl` | content.md |
|
||||
@@ -159,16 +160,16 @@ Mandatory set: AGENT.md §0b, skill **ipal-setup**; checks: **ipal-audit**, **ip
|
||||
| image lightbox (optional) | layout + blocks | `lightbox: true` in `ipalKit`; `<SiteProviders shell lightbox>`; `<LightboxTrigger group image={lightboxImage(media, { size: 'hero' })}>` around the thumbnail (`/client`); `<RenderRichText lightbox>` | keyboard: Tab to a thumbnail, Enter → dialog with focus on Close, ←/→, Esc → focus back; Network: a resized file on a phone | lightbox.md |
|
||||
| image on the frontend | `Media` primitive | `<Image {...mediaImageProps(media, { sizes })} />`, video `videoProps` | blur before load | media.md |
|
||||
| storage | `payload.config.ts` | `buildR2Storage(['media'], { s3Storage })` — always (without `R2_*` = local disk) | upload → URL from `R2_PUBLIC_URL` | storage.md |
|
||||
| e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP from the panel / Graph from env; also `panelSmtpAdapter`, `graphAdapter`, `sendEmail` from `/server`) | Site Integrations → SMTP → **Send test** | email.md |
|
||||
| e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP from the panel / Graph from env; also `panelSmtpAdapter`, `graphAdapter`, `sendEmail` from `/server`) | Site integrations → SMTP → **Send test** | email.md |
|
||||
| forms — action | `app/(frontend)/[locale]/actions.ts` | `'use server'`; `export const sendForm = createSubmitAction({ getCachedPayload, headers })` (`/server`) | submit → document in Form Submissions + e-mails | forms.md, skill **ipal-form** |
|
||||
| forms — render | form block | `<RenderForm form={form} action={sendForm} locale={locale} texts={formTexts} classNames={formClasses} />` (`/rsc`) | form from the panel, Turnstile, message from Notifications | forms.md |
|
||||
| Turnstile | panel / env | `SiteProviders` wires `TurnstileProvider`; keys in Site Integrations → Turnstile or env; server: `verifyTurnstile` (`/server`) | widget in the form; dashboard alert on a bad key | turnstile.md |
|
||||
| Turnstile | panel / env | `SiteProviders` wires `TurnstileProvider`; keys in Site integrations → Turnstile or env; server: `verifyTurnstile` (`/server`) | widget in the form; dashboard alert on a bad key | turnstile.md |
|
||||
| consent | layout + policy page | banner via `SiteProviders`; table `<CookieTable rows={…} labels={…} />` (`/rsc`) from `getCookieTable` | `ipal-consent-check`; delete the consent cookie → the banner comes back | consent.md |
|
||||
| cookie crawl | config + env + service | `cookieScanner: { crawl: true }`, `IPAL_COOKIE_SCAN_URL` / `IPAL_COOKIE_SCAN_TOKEN`, site in the service's `IPAL_CRAWLER_SITES`; optional Coolify scheduled task `curl -X POST -H "Authorization: Bearer $IPAL_COOKIE_SCAN_TOKEN" $U/api/ipal/cookie-crawl` | **Crawl site** → "Last crawl …: N pages, N violations"; *Settings → Cookie crawl* | cookie-scanner.md → Browser crawl |
|
||||
| cookie list | config | `cookieScanner: true` (+ `declarations` for embeds/chat), `generate:importmap`, `migrate:create` | *Cookie review* → **Scan cookies** → accept → Cookie Settings → Cookies; `<CookieBanner settings="detailed">` lists it | cookie-scanner.md |
|
||||
| cookie crawl | config + env + service | `cookieScanner: { crawl: true }`, `IPAL_COOKIE_SCAN_URL` / `IPAL_COOKIE_SCAN_TOKEN`, site in the service's `IPAL_CRAWLER_SITES`; optional Coolify scheduled task `curl -X POST -H "Authorization: Bearer $IPAL_COOKIE_SCAN_TOKEN" $U/api/ipal/cookie-crawl` | **Check site** → "Last crawl …: N pages, N violations"; *Privacy → Cookie check* | cookie-scanner.md → Browser crawl |
|
||||
| cookie list | config | `cookieScanner: true` (+ `declarations` for embeds/chat), `generate:importmap`, `migrate:create` | *Cookie review* → **Scan cookies** → accept → Cookie banner → Cookie list; `<CookieBanner settings="detailed">` lists it | cookie-scanner.md |
|
||||
| proof of consent | config + layout | `consentLog: true` + `logEndpoint="/api/ipal/consent"` | after a click, a document in Consent Records | consent.md |
|
||||
| stats | config + layout | `stats: true` + `<SiteProviders stats={{ locale }}>` (or `<PageStats locale />` inside `ConsentProvider`) | `/<admin>/stats`; `POST /api/ipal/hit` request in Network | stats.md |
|
||||
| analytics | layout | `SiteProviders` wires `Analytics` (ID from Site Integrations → Analytics); Consent Mode: `analytics={{ consentMode: 'basic' }}` = no request to Google before consent, default `'advanced'` = the Google tag loads at once with every signal `denied` | Meta/other pixels only after consent; in `basic` no `gtm.js` / `gtag/js` in Network before consent | analytics.md, gtm-meta-pixel.md |
|
||||
| analytics | layout | `SiteProviders` wires `Analytics` (ID from Site integrations → Analytics); Consent Mode: `analytics={{ consentMode: 'basic' }}` = no request to Google before consent, default `'advanced'` = the Google tag loads at once with every signal `denied` | Meta/other pixels only after consent; in `basic` no `gtm.js` / `gtag/js` in Network before consent | analytics.md, gtm-meta-pixel.md |
|
||||
| extra JSON-LD | layout / `lib/content` | `jsonLd={[buildNavigationJsonLd(…)]}`; `siteJsonLd` → `buildLocalBusinessJsonLd` | Rich Results Test | seo.md |
|
||||
| links and navigation | components | `buildLinkField`/`buildLinksField` in fields; `resolveNav`, `resolveLink`, `getSystemLinks` | a menu link still works after a slug change | links.md, skill **ipal-nav** |
|
||||
| blocks | `src/blocks/registry.ts` | `blocks` for `createPageRoute`; fields `buildSectionHeaderField`, `buildSectionSettingsField` | block visible on the page | blocks.md, skill **ipal-block** |
|
||||
@@ -182,7 +183,7 @@ Mandatory set: AGENT.md §0b, skill **ipal-setup**; checks: **ipal-audit**, **ip
|
||||
| key | use |
|
||||
|---|---|
|
||||
| `getCachedPayload` | `await getCachedPayload()` — Local API (actions, routes) |
|
||||
| `getSettings(locale)` | Site Settings (`depth: 1`: relations as documents, theirs as ids; `settingsDepth` option changes it) |
|
||||
| `getSettings(locale)` | Site settings (`depth: 1`: relations as documents, theirs as ids; `settingsDepth` option changes it) |
|
||||
| `getConfiguredLocales()` | layout: `notFound()` for an unknown language |
|
||||
| `resolveRoute`, `getEntries`, `getNotFoundPage`, `resolvePageRedirect` | your own page / archive instead of `createPageRoute` |
|
||||
| `generatePageMetadata`, `generateStaticParams`, `getPageJsonLd` | used by `createPageRoute`; call by hand in your own pages |
|
||||
@@ -212,10 +213,10 @@ and what throws without `i18n`: frontend.md. `SiteProviders` props: `shell`, `ba
|
||||
| `R2_BUCKET`, `R2_ENDPOINT`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY` | `storage: true` + production, or when at least one is set (all or none) | local disk (in prod files disappear on redeploy); incomplete set → warning | env |
|
||||
| `R2_PUBLIC_URL` | optional; required only with `ipalEnvRules({ storage: { requirePublicUrl: true } })` (then like the other `R2_*`); absolute URL in prod when set | empty (default) → media served by the app at `/api/media/file/…` (Media needs `access.read: () => true`); set it only for a media domain on Cloudflare (storage.md); `R2_PUBLIC_URL` alone in dev = media read-only; `/media` allowed outside prod; also used by `buildImagesConfig`, `MediaPreconnect`, CSP | env |
|
||||
| `GRAPH_TENANT_ID`, `GRAPH_CLIENT_ID`, `GRAPH_CLIENT_SECRET`, `GRAPH_SENDER` | `emailGraph: true` / Graph transport in the panel | `mailAdapter` falls back to SMTP from the panel (logged) | env (agency Exchange) |
|
||||
| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | `turnstile: true` (names: `siteKeyVar`/`secretVar`) | fallback for keys from Site Integrations → Turnstile; neither set → Turnstile off | panel (takes precedence) or env |
|
||||
| `INDEXNOW_KEY` | no | key from Site Integrations → IndexNow (generated) | env or panel |
|
||||
| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | `turnstile: true` (names: `siteKeyVar`/`secretVar`) | fallback for keys from Site integrations → Turnstile; neither set → Turnstile off | panel (takes precedence) or env |
|
||||
| `INDEXNOW_KEY` | no | key from Site integrations → IndexNow (generated) | env or panel |
|
||||
| `IPAL_IP_HEADER` | `ipHeader: true` + production | rate limit trusts any IP header (spoofing) + warning in prod | env: `cf-connecting-ip` (Cloudflare) / `x-forwarded-for` (Traefik/nginx) |
|
||||
| `IPAL_COOKIE_SCAN_URL`, `IPAL_COOKIE_SCAN_TOKEN` | `cookieScanner.crawl` (`ipalEnvRules({ cookieCrawl: true })` requires both in production; token ≥ 16 chars) | **Crawl site** disabled, the box names the missing variable | env; the token also goes into the scanner service's `IPAL_CRAWLER_SITES` as `host=token` |
|
||||
| `IPAL_COOKIE_SCAN_URL`, `IPAL_COOKIE_SCAN_TOKEN` | `cookieScanner.crawl` (`ipalEnvRules({ cookieCrawl: true })` requires both in production; token ≥ 16 chars) | **Check site** disabled, the box names the missing variable | env; the token also goes into the scanner service's `IPAL_CRAWLER_SITES` as `host=token` |
|
||||
| `IPAL_NOINDEX` | no; `1`/`true`/`yes` **staging/preview only** | — (when set: robots Disallow, meta noindex, `X-Robots-Tag`, IndexNow sends nothing) | staging env |
|
||||
| `NEXT_PHASE` | set by Next | only tells `next build` from runtime: during the build an unreachable database gives an empty sitemap; at runtime the sitemap throws (route → 503) | do not set by hand |
|
||||
| `NEXT_RUNTIME` | set by Next | `instrumentation.ts` checks for `nodejs`; missing (scripts, seed) → `buildRevalidateHook` does not revalidate | do not set by hand |
|
||||
|
||||
@@ -52,7 +52,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
|
||||
| `hasMinimumRole(user, minimum)` | `@intecion/ipal-kit` | Predicate → `boolean`: whether the user has a role ≥ `minimum` (reads `user.roles` safely). For your own access logic/hooks. |
|
||||
| `isAdmin(user)` | `@intecion/ipal-kit` | Predicate → `boolean`: `admin` role. |
|
||||
| `isEditor(user)` | `@intecion/ipal-kit` | Predicate → `boolean`: `editor` or higher. |
|
||||
| `userMeetsRole(req, minimum)` | `@intecion/ipal-kit` | Predicate → `boolean` with `req` (`{ payload, user }`): role ≥ `minimum`, **or** any logged-in user when the user's auth collection has no `roles` field (the project omitted `access`). The plugin's staff features use it (Site Integrations, settings globals, test e-mail, stats, consent records, form submissions). Use it in your own access when the project may run without roles. |
|
||||
| `userMeetsRole(req, minimum)` | `@intecion/ipal-kit` | Predicate → `boolean` with `req` (`{ payload, user }`): role ≥ `minimum`, **or** any logged-in user when the user's auth collection has no `roles` field (the project omitted `access`). The plugin's staff features use it (Site integrations, settings globals, test e-mail, stats, consent records, form submissions). Use it in your own access when the project may run without roles. |
|
||||
| `ROLE_HIERARCHY` | `@intecion/ipal-kit` | Constant `['user', 'editor', 'admin']` (lowest first) — a higher role meets the requirements of a lower one. The plugin injects the `roles` field into the auth collection (`access.authCollection`). |
|
||||
| `buildRolesField(defaultRole?, { firstUserAdmin? })` | `@intecion/ipal-kit` | The `roles` select field the plugin injects (only admins set roles; `firstUserAdmin` default `true` = the account made on "Create first user" gets `admin`). The plugin wires it itself — use it only for an auth collection the plugin does not manage. |
|
||||
| `injectRoles(config, accessOption)` | `@intecion/ipal-kit` | Adds `roles` to `accessOption.authCollection` in a config. The plugin calls it itself with `access` — do not call. |
|
||||
@@ -68,6 +68,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
|
||||
| `useAccessibility()` | `@intecion/ipal-kit/client` | Hook → `{ state, set(key, value), reset() }` — for your own accessibility UI. Inside `AccessibilityProvider`. |
|
||||
| `A11Y_COOKIE` | `@intecion/ipal-kit` | Preferences cookie name: `'a11y-prefs'` — read it in SSR to set attributes without a flash. |
|
||||
| `A11Y_DEFAULT` | `@intecion/ipal-kit` | Default `A11yState` (everything off, `contrast: 'default'`, `textSize: 0`, `lineHeight: 0`). |
|
||||
| `A11Y_DEFAULT_TEXTS` | `@intecion/ipal-kit/client` | Accessibility widget texts per language (`en`, `pl`); the widget's `locale` prop picks one, `texts` wins |
|
||||
| `parseA11y(raw)` | `@intecion/ipal-kit` | Cookie value → `A11yState` (`A11Y_DEFAULT` on error). For SSR in the layout. |
|
||||
| `serializeA11y(state)` | `@intecion/ipal-kit` | `A11yState` → JSON string for the cookie. |
|
||||
| `a11yAttributes(state)` | `@intecion/ipal-kit` | `A11yState` → `{ 'data-a11y-*': string \| null }` (null = remove the attribute). To set attributes on `<html>` in SSR. |
|
||||
@@ -111,14 +112,14 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
|
||||
| `useConsent(options?)` | `@intecion/ipal-kit/client` | Low-level consent state hook → `{ state, decided, consentId, acceptAll, rejectAll, savePreferences, reopen }`. Usually use `ConsentProvider` + `useConsentContext` (the provider calls it itself). |
|
||||
| `useConsentContext()` | `@intecion/ipal-kit/client` | Hook: the `useConsent` value + `texts` from `ConsentProvider` — for your own consent-dependent UI (e.g. `state.marketing`). Throws outside the provider. |
|
||||
| `getConsentTexts({ payload, config, locale?, privacyPolicy?, settingsSlug? })` | `@intecion/ipal-kit` | Server: banner texts from the CookieSettings global (EN fallback per field) + privacy policy link from the system pages → `Promise<ConsentTexts>`; pass to `ConsentProvider texts`. |
|
||||
| `getCookieTable({ payload, locale? })` | `@intecion/ipal-kit` | Server: Cookie Settings → Cookies rows in one language → `Promise<CookieTableRow[]>` (does not throw) — for `CookieTable`. |
|
||||
| `getCookieTable({ payload, locale? })` | `@intecion/ipal-kit` | Server: Cookie banner → Cookie list rows in one language → `Promise<CookieTableRow[]>` (does not throw) — for `CookieTable`. |
|
||||
| `setDefaultConsent(state)` | `@intecion/ipal-kit` | Google Consent Mode `consent default` (with `wait_for_update`). `Analytics` calls it itself before loading Google tags — do not call. |
|
||||
| `updateConsent(state)` | `@intecion/ipal-kit` | Google Consent Mode `consent update` after the decision. `useConsent` calls it itself — do not call. |
|
||||
| `parseConsent(raw, version?)` | `@intecion/ipal-kit` | Consent cookie value → `ConsentState \| null` (null: missing, error or a different policy version). For server-side gating. |
|
||||
| `readConsentRecord(raw, version?)` | `@intecion/ipal-kit` | Like `parseConsent`, but the full record `{ id, state, timestamp, version } \| null`. |
|
||||
| `serializeConsent(state, version?, id?)` | `@intecion/ipal-kit` | `ConsentState` → encoded cookie value (with timestamp and version). Usually the provider does this. |
|
||||
| `CONSENT_COOKIE` | `@intecion/ipal-kit` | Consent cookie name: `'cookie-consent'`. |
|
||||
| `CONSENT_VERSION` | `@intecion/ipal-kit` | Default policy version: `1` (overridden in the panel: Cookie Settings → Policy version; changing it invalidates old consents). |
|
||||
| `CONSENT_VERSION` | `@intecion/ipal-kit` | Default policy version: `1` (overridden in the panel: Cookie banner → Policy version; changing it invalidates old consents). |
|
||||
| `CONSENT_MAX_AGE` | `@intecion/ipal-kit` | Consent cookie lifetime in seconds: 180 days. |
|
||||
| `CONSENT_CATEGORIES` | `@intecion/ipal-kit` | `['necessary', 'functional', 'analytics', 'marketing']`; `necessary` always on. |
|
||||
| `DEFAULT_CONSENT` | `@intecion/ipal-kit` | State before the decision: only `necessary: true`. |
|
||||
@@ -128,6 +129,8 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
|
||||
| `buildConsentLogCollection()` | `@intecion/ipal-kit` | Consent log collection (id, choices, version, time — no IP/personal data; proof of consent under GDPR Art. 7(1)). The plugin wires it itself with `consentLog: true` — do not call. |
|
||||
| `buildConsentLogEndpoint({ retentionDays? })` | `@intecion/ipal-kit` | `POST /api/ipal/consent` endpoint that saves decisions and deletes records older than `retentionDays` (default 1095). The plugin wires it itself with `consentLog` — do not call. |
|
||||
|
||||
**Built-in texts:** `CONSENT_FALLBACK`, `CONSENT_FALLBACK_PL`, `consentFallback(locale)` (banner defaults by page language), `CONSENT_CATEGORY_LABELS` / `consentCategoryOptions()` (category names `{ en, pl }`), `COOKIE_TABLE_LABELS` (`/rsc`, `<CookieTable locale>` defaults).
|
||||
|
||||
**Types:** `ConsentCategory`, `ConsentState`, `ConsentTexts`, `CookieTableRow`, `ConsentLogOptions` (root) — categories, consent state, banner texts, cookie table row, log options; `CookieBannerAction`, `CookieSettingsAction`, `CookieBannerClassNames` (`/client`) — `CookieBanner` buttons and classes; `CookieTableLabels` (`/rsc`) — `CookieTable` column headers.
|
||||
|
||||
## Cookie scanner (`consent/scanner`) — details: `node_modules/@intecion/ipal-kit/docs/cookie-scanner.md`
|
||||
@@ -139,11 +142,11 @@ Opt-in with `ipalKit({ cookieScanner: true })`; the plugin wires the collection,
|
||||
| `runCookieScan({ payload, plugin, options?, names?, req? })` | `@intecion/ipal-kit` | The whole scan as `POST /api/ipal/cookie-scan` runs it → `{ enabled, summary }` (`plugin` = `{ localeCount, stats }`). |
|
||||
| `collectCookieFindings({ ctx, integrations?, declarations?, names?, database?, databaseCategories? })` | `@intecion/ipal-kit` | Findings for the project without writing: enabled integrations' cookies, project declarations, extra names looked up (declarations → built-ins → Open Cookie Database → `unknown`). |
|
||||
| `applyCookieFindings({ payload, findings, req?, collection? })` | `@intecion/ipal-kit` | Writes findings to `cookie-review` as drafts: new names created, existing ones updated only where the editor did not change the value; status untouched, nothing deleted → `CookieScanSummary`. |
|
||||
| `cookieScanContext(payload, plugin, req?)` | `@intecion/ipal-kit` | Builds the `CookieScanContext` (Site Integrations + module switches). |
|
||||
| `cookieScanContext(payload, plugin, req?)` | `@intecion/ipal-kit` | Builds the `CookieScanContext` (Site integrations + module switches). |
|
||||
| `parseCookieNames(input)` | `@intecion/ipal-kit` | Text box / array → clean, unique names (max 200; no spaces, `;`, `,`, `=`). |
|
||||
| `mergeCookieReview(current, previous, next)` | `@intecion/ipal-kit` | Pure "never overwrite an edit" rule, per field and per locale. |
|
||||
| `suggestionFor(finding, locales)` | `@intecion/ipal-kit` | A finding's values resolved per locale (own language → English → first). |
|
||||
| `addToCookieList({ payload, entry, req? })` | `@intecion/ipal-kit` | What accepting does: adds the row to Cookie Settings → Cookies or fills only its empty text, every locale → `'added' \| 'filled' \| 'unchanged'`. |
|
||||
| `addToCookieList({ payload, entry, req? })` | `@intecion/ipal-kit` | What accepting does: adds the row to Cookie banner → Cookie list or fills only its empty text, every locale → `'added' \| 'filled' \| 'unchanged'`. |
|
||||
| `loadCookieDatabase()` / `indexCookieDatabase(rows)` / `lookupCookie(index, name, categories?)` | `@intecion/ipal-kit` | Bundled Open Cookie Database (Apache-2.0, loaded on first use): exact name, then the longest wildcard prefix → `CookieFinding \| null`. |
|
||||
| `DEFAULT_DATABASE_CATEGORIES` | `@intecion/ipal-kit` | Database → consent category map (Functional → `functional` on purpose; override with `cookieScanner.databaseCategories`). |
|
||||
| `DEFAULT_COOKIE_INTEGRATIONS` | `@intecion/ipal-kit` | Built-in declarations: consent cookie, admin login, `NEXT_LOCALE`, `ipal_vid`, GA4, GTM, Meta Pixel, Clarity, LinkedIn, TikTok, Turnstile — each with its `isEnabled` check. |
|
||||
@@ -189,12 +192,12 @@ Opt-in with `ipalKit({ cookieScanner: true })`; the plugin wires the collection,
|
||||
|---|---|---|
|
||||
| `resolveRoute({ payload, locale, segments, page, content, draft? })` | `@intecion/ipal-kit` | resolves a catch-all path → `{ type: 'home'\|'page'\|'archive'\|'entry', doc, … }` or `null` (404); usually through `resolveRoute` from `createContentHelpers` |
|
||||
| `getArchiveEntries({ payload, collection, locale, page, perPage, sort?, where?, depth?, draft? })` | `@intecion/ipal-kit` | fetches a page of archive entries (`ArchiveEntries`); `getEntries` from `createContentHelpers` has the defaults |
|
||||
| `archiveFieldName(slug)` | `@intecion/ipal-kit` | name of the archive field in System Pages (`'posts'` → `'postsArchive'`); the plugin adds these fields itself |
|
||||
| `archiveFieldName(slug)` | `@intecion/ipal-kit` | name of the archive field in System pages (`'posts'` → `'postsArchive'`); the plugin adds these fields itself |
|
||||
| `buildEntryPath({ locale, archiveSlug, entrySlug })` | `@intecion/ipal-kit` | entry path `/pl/artykuly/moj-post` (always with the locale prefix) |
|
||||
| `buildArchivePath({ locale, archiveSlug, page })` | `@intecion/ipal-kit` | listing path with `?page=N` pagination (page 1 without a query) |
|
||||
| `parsePageParam(value)` | `@intecion/ipal-kit` | `?page=` → number ≥ 1 (junk/missing → 1) |
|
||||
| `resolveRedirect({ payload, locale, segments, config, homeSlug, collections? })` | `@intecion/ipal-kit` | looks up an old slug in `slugHistory` → path for `permanentRedirect` or `null`; pairs with `trackSlugHistoryHook` — do not write your own lookup |
|
||||
| `resolveNotFoundPage({ payload, locale, pagesSlug?, settingsSlug? })` | `@intecion/ipal-kit` | page assigned as 404 in System Pages or `null`; does not throw (with the helpers: `getNotFoundPage`) |
|
||||
| `resolveNotFoundPage({ payload, locale, pagesSlug?, settingsSlug? })` | `@intecion/ipal-kit` | page assigned as 404 in System pages or `null`; does not throw (with the helpers: `getNotFoundPage`) |
|
||||
| `blocksToMarkdown(layout, { overrides? })` | `@intecion/ipal-kit` | page blocks → Markdown by field naming convention (heading, body, items…) |
|
||||
| `createMarkdownRenderer({ content, collection?, layoutField?, overrides?, frontmatter?, baseUrl?, config? })` | `@intecion/ipal-kit` | returns `render({ payload, locale, slug })` → page Markdown (GEO) or `null` |
|
||||
| `createMarkdownRoute({ getCachedPayload, content, config, baseUrl })` | `@intecion/ipal-kit` | ready `GET` handler for the `/md/...` route; usually `markdownRoute` from `createContentHelpers` is enough |
|
||||
@@ -213,7 +216,7 @@ Opt-in with `ipalKit({ cookieScanner: true })`; the plugin wires the collection,
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `mailAdapter({ smtp?, graph?, fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | recommended adapter for `buildConfig({ email })`: on every send picks SMTP or Graph per the panel setting and saves the integration status; the plugin does not set `config.email` itself |
|
||||
| `panelSmtpAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | Payload adapter that always sends through the SMTP configured in Site Integrations |
|
||||
| `panelSmtpAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | Payload adapter that always sends through the SMTP configured in Site integrations |
|
||||
| `graphAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | Payload adapter through Microsoft Graph (Exchange/M365; `GRAPH_*` credentials from env) |
|
||||
| `sendEmail({ payload, to, subject, html, text?, from?, replyTo? })` | `@intecion/ipal-kit/server` | sends your own e-mail (your HTML) always through SMTP from the panel → `{ sent: true, messageId }` / `{ sent: false, error }`; does not throw; server code only |
|
||||
|
||||
@@ -291,13 +294,13 @@ Full option lists of `createContentHelpers` / `createPageRoute` / `SiteProviders
|
||||
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `recordIntegrationStatus(payload, field, previous, { state, code?, message? })` | `@intecion/ipal-kit` | saves the state of your own integration in Site Integrations (only on change / every 10 min); does not throw. For e-mail and Turnstile the plugin calls it itself — do not call |
|
||||
| `recordIntegrationStatus(payload, field, previous, { state, code?, message? })` | `@intecion/ipal-kit` | saves the state of your own integration in Site integrations (only on change / every 10 min); does not throw. For e-mail and Turnstile the plugin calls it itself — do not call |
|
||||
| `buildIntegrationStatusField(name)` | `@intecion/ipal-kit` | hidden status group field (`state`, `code`, `message`, `since`, `checkedAt`) for `integrationsFields` |
|
||||
| `buildIntegrationStatusBanner(statusField, label)` | `@intecion/ipal-kit` | UI field with a status banner on the integration tab (`integrationsFields`; then `pnpm generate:importmap`) |
|
||||
| `buildIntegrationStatusBanner(statusField, label, texts?)` | `@intecion/ipal-kit` | UI field with a status banner on the integration tab (`label` string or `{ en, pl }`; `texts` = `{ failing, hint }` keys of your own `ipal` translations) (`integrationsFields`; then `pnpm generate:importmap`) |
|
||||
| `IntegrationAlerts` | `@intecion/ipal-kit/admin` | dashboard alert about integrations in the `degraded` state; always injected by the plugin (`beforeDashboard`); your own integrations: a second instance with `checks` |
|
||||
| `IntegrationStatusBanner` | `@intecion/ipal-kit/admin` | status banner on the tab; injected by the plugin / `buildIntegrationStatusBanner` through the import map (`pnpm generate:importmap`), the project does not import it |
|
||||
|
||||
**Types:** `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus` — integration state and saved status.
|
||||
**Types:** `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus` — integration state and saved status; `IntegrationLabel` (`string | { en, pl }`) — banner / alert label; `IntegrationBannerTexts` (`{ failing, hint }` text keys) — third argument of `buildIntegrationStatusBanner` for your own wording.
|
||||
|
||||
## Forms (`forms`) — details: `node_modules/@intecion/ipal-kit/docs/forms.md`
|
||||
|
||||
@@ -367,6 +370,7 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
| `pattern(re, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: matches a regex (empty values skipped — combine with `required`) |
|
||||
| `custom(test, msg)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule from any predicate `(value, values) => boolean` |
|
||||
| `isEmail(v)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Standalone e-mail check → boolean |
|
||||
| `localizedRules(locale)`, `validationMessages(locale)`, `VALIDATION_MESSAGES` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Validators with default messages in the page language (en/pl); type `ValidationMessages` |
|
||||
|
||||
### Analytics
|
||||
|
||||
@@ -385,7 +389,7 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
| `resolveLinkHref(link, { locale, config, homeSlug?, archives?, pagesSlug? })` | `@intecion/ipal-kit` | Link value → href or `null` (empty / page missing in the language / unsafe URL); the page must be populated |
|
||||
| `resolveLink(link, options)` | `@intecion/ipal-kit` | Panel link → `ResolvedLink` (`href`, `label`, `newTab`, `internal`, `targetProps`, `appearance`) or `null` — for your own `CMSLink` |
|
||||
| `resolveNav(items, { locale, config, homeSlug?, linkField?, childrenField? })` | `@intecion/ipal-kit` | Menu items from the Header/Footer global → serializable `NavItem[]` (any depth, dead links skipped) |
|
||||
| `resolveSystemLinks(settings, { locale, config, roles?, … })` | `@intecion/ipal-kit` | Links to system pages from Site Settings (privacy/cookies/terms) with the page title as the label → `SystemLink[]`; in a project usually `getSystemLinks` from `lib/content` |
|
||||
| `resolveSystemLinks(settings, { locale, config, roles?, … })` | `@intecion/ipal-kit` | Links to system pages from Site settings (privacy/cookies/terms) with the page title as the label → `SystemLink[]`; in a project usually `getSystemLinks` from `lib/content` |
|
||||
| `homeSlugFrom(settings, field?)` | `@intecion/ipal-kit` | Homepage slug from `SiteSettings.homepage` (populated) or `undefined` |
|
||||
| `safeHref(url)` | `@intecion/ipal-kit` | The URL when safe (http(s), mailto, tel, sms, #, `/` path), otherwise `null` — blocks `javascript:`/`data:` |
|
||||
|
||||
@@ -408,9 +412,10 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
| `lightboxImage(media, { size?, sizes?, srcSet?, alt?, caption? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Payload media doc → `LightboxImage` (`src` from `size`, `srcSet` from every Payload size + original, alt, caption) or `null` (video, PDF, id) |
|
||||
| `withLightboxUploads(converters?, { group?, image?, triggerClassName? })` | `@intecion/ipal-kit/rsc` | Wraps rich text image uploads in `LightboxTrigger` on top of your converters (`RenderRichText lightbox` uses it) |
|
||||
| `LIGHTBOX_FALLBACK`, `resolveLightboxTexts(texts)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | English labels; partial texts → full set (empty → fallback) |
|
||||
| `LIGHTBOX_FALLBACK_PL`, `lightboxFallback(locale)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Polish lightbox labels; set for a page language. `resolveLightboxTexts(texts, locale)` uses it |
|
||||
| `lightboxIndex(index, delta, total, loop?)`, `formatLightboxCounter(template, current, total)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Wrap / clamp a gallery index; "{current} / {total}" → "2 / 5" |
|
||||
| `prefersReducedMotion()` | `@intecion/ipal-kit/client` | OS reduced motion or the AccessibilityWidget switch (`data-a11y-motion="reduce"`) |
|
||||
| `lightboxNotificationFields` | `@intecion/ipal-kit` | The Notifications → Lightbox field group (added by `ipalKit({ lightbox: true })`) — to place in your own global |
|
||||
| `lightboxNotificationFields` | `@intecion/ipal-kit` | The Form messages → Image viewer field group (added by `ipalKit({ lightbox: true })`) — to place in your own global |
|
||||
|
||||
**Types:** `LightboxImage`, `LightboxTexts`, `LightboxClassNames`, `LightboxRenderImage`, `LightboxImageOptions` (root and `/client`); `LightboxApi`, `LightboxProviderProps`, `LightboxTriggerProps`, `LightboxDialogProps` (`/client`); `RichTextLightboxOptions` (`/rsc`). Styling: `--ipal-lightbox-*` CSS variables, `data-ipal="lightbox…"` hooks.
|
||||
|
||||
@@ -434,9 +439,10 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getNotificationTexts({ payload, locale? })` | `@intecion/ipal-kit` | Reads the Notifications global in a language → `NotificationTexts` (`form.success`, `error`, `validation`, `next`, `back`, `stepOf`, …) with an EN fallback per field; source of `texts` for `RenderForm` (usually `getFormTexts` from `lib/content`) |
|
||||
| `getNotificationTexts({ payload, locale? })` | `@intecion/ipal-kit` | Reads the Form messages global (`notifications`) in a language → `NotificationTexts` (`form.success`, `error`, `validation`, `next`, `back`, `stepOf`, …) with an EN fallback per field; source of `texts` for `RenderForm` (usually `getFormTexts` from `lib/content`) |
|
||||
| `resolveFormMessage(result, texts)` | `@intecion/ipal-kit` | `SubmitFormResult` code → text from the panel (`{field}` filled in for `validation`, `error` without exception details); `createSubmitAction` calls it itself |
|
||||
| `NOTIFICATION_FALLBACK` | `@intecion/ipal-kit` | Constant: built-in English `form.*` texts used when a panel field is empty |
|
||||
| `NOTIFICATION_FALLBACK_PL`, `notificationFallback(locale)` | `@intecion/ipal-kit` | Polish defaults; picks the set for a page language (`pl` → Polish, else English) |
|
||||
|
||||
**Types:** `NotificationTexts`, `FormNotificationTexts` — resolved notification texts (`form` group; `lightbox` group = `LightboxTexts`, see Image lightbox).
|
||||
|
||||
@@ -444,7 +450,7 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getSystemPagePath({ page, locale, config, homeSlug? })` | `@intecion/ipal-kit` | Page assigned in Site Settings (read with `locale: 'all'`) → path in the language (`/pl` for the homepage, `/en/privacy-policy`) or `undefined` |
|
||||
| `getSystemPagePath({ page, locale, config, homeSlug? })` | `@intecion/ipal-kit` | Page assigned in Site settings (read with `locale: 'all'`) → path in the language (`/pl` for the homepage, `/en/privacy-policy`) or `undefined` |
|
||||
| `ALL_SYSTEM_PAGE_ROLES` | `@intecion/ipal-kit` | Constant: all system page roles in a fixed order: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` |
|
||||
| `LocaleView({ views, defaultLocale })` | `@intecion/ipal-kit/client` | Picks, from ready per-language views, the one from the URL (`/en/...`) — in `not-found.tsx` without `headers()` (the route stays static); used by `createNotFoundPage` |
|
||||
| `NotFoundLoader({ load, locales, defaultLocale })` | `@intecion/ipal-kit/client` | Lazy 404 content: fetches the view from a server action only when the 404 is shown (smaller RSC payload on every page); used by `createNotFoundPage(content, { load })` |
|
||||
@@ -455,8 +461,8 @@ The editor builds forms in the panel (Forms collection). The project does NOT wr
|
||||
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getSiteSettings<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Reads the Site Settings global (generated type `SiteSetting` as `T`) |
|
||||
| `getSiteIntegrations<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Reads the Site Integrations global with secrets (the Local API bypasses access) — server only, never raw to the client |
|
||||
| `getSiteSettings<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Reads the Site settings global (generated type `SiteSetting` as `T`) |
|
||||
| `getSiteIntegrations<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Reads the Site integrations global with secrets (the Local API bypasses access) — server only, never raw to the client |
|
||||
| `getGlobal<T>(payload, slug, { locale?, depth? })` | `@intecion/ipal-kit` | Thin `payload.findGlobal` wrapper for any global (the project's too) |
|
||||
| `SITE_SETTINGS_SLUG` | `@intecion/ipal-kit` | Constant: global slug `'site-settings'` |
|
||||
| `SITE_INTEGRATIONS_SLUG` | `@intecion/ipal-kit` | Constant: global slug `'site-integrations'` |
|
||||
@@ -515,7 +521,7 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
|
||||
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createPageMetadata({ config, baseUrl, content?, … })` | `@intecion/ipal-kit` | Page metadata generator with the plugin's convention resolvers wired in (Pages, SiteSettings, `meta`, System Pages, archives); call it with `{ payload, locale, slug }`. Normally through `generatePageMetadata` from `createContentHelpers`. |
|
||||
| `createPageMetadata({ config, baseUrl, content?, … })` | `@intecion/ipal-kit` | Page metadata generator with the plugin's convention resolvers wired in (Pages, SiteSettings, `meta`, System pages, archives); call it with `{ payload, locale, slug }`. Normally through `generatePageMetadata` from `createContentHelpers`. |
|
||||
| `createMetadataGenerator({ config, baseUrl, resolveDocument, … })` | `@intecion/ipal-kit` | As above, but with your own resolvers — for routes with non-standard conventions. |
|
||||
| `buildMetadata({ meta, siteName, locale, config, slugs, baseUrl, … })` | `@intecion/ipal-kit` | Builds a Next.js `Metadata` object (title, canonical, hreflang, OG, Twitter, robots) from ready data; fetches nothing. The lowest level. |
|
||||
| `composeTitle({ pageTitle, siteName, separator?, order? })` | `@intecion/ipal-kit` | Full title "Page \| Company" (or the other way round), without duplicating the site name. |
|
||||
@@ -523,7 +529,7 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
|
||||
| `slugsAcrossLocales({ payload, collection, id, config })` | `@intecion/ipal-kit` | Document slug in all languages (separate query, depth 0) — input for hreflang. |
|
||||
| `readSiteMetaConfig({ payload, locale, pagesSlug?, settingsSlug?, settings? })` | `@intecion/ipal-kit` | Reads from SiteSettings: site name, separator (with padding), title order, homepage slug per language, default description and OG image. |
|
||||
| `buildIconsMetadata(favicon)` | `@intecion/ipal-kit` | `icons` (favicon, apple-touch-icon) from the favicon upload in the panel — once in the root layout `generateMetadata`. |
|
||||
| `verificationFrom(settings)` | `@intecion/ipal-kit` | Site Settings → Search & AI verification codes → Next `Metadata.verification` (`google`, `yandex`, `other['msvalidate.01']` for Bing); `undefined` when every field is empty. `generatePageMetadata` adds it itself — by hand only in your own metadata. |
|
||||
| `verificationFrom(settings)` | `@intecion/ipal-kit` | Site settings → Search engines verification codes → Next `Metadata.verification` (`google`, `yandex`, `other['msvalidate.01']` for Bing); `undefined` when every field is empty. `generatePageMetadata` adds it itself — by hand only in your own metadata. |
|
||||
| `createManifestHandler({ getCachedPayload, config, settingsSlug? })` | `@intecion/ipal-kit` | `app/manifest.ts` handler from SiteSettings; without a database at build time it returns a minimal manifest. Usually `manifest` from `createContentHelpers`. |
|
||||
| `NoSnippet({ as?, children })` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit/rsc` | Wrapper with `data-nosnippet` — keeps repeated text (footer: address, hours, phone) out of Google snippets. Do not wrap `<main>`. |
|
||||
|
||||
@@ -561,7 +567,7 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
|
||||
| `buildRobots({ baseUrl, aiBots?, disallowParams?, extraDisallow?, … })` | `@intecion/ipal-kit` | `app/robots.ts` rules: blocks admin/API, points to the sitemap, explicitly allows AI bots (`aiBots: 'allow' \| 'block-training' \| 'disallow'`); with `IPAL_NOINDEX` blocks everything. Usually `robots` from `createContentHelpers`. |
|
||||
| `AI_ASSISTANT_BOTS` | `@intecion/ipal-kit` | List of user agents of AI assistant/search bots (ClaudeBot, PerplexityBot…). |
|
||||
| `AI_TRAINING_BOTS` | `@intecion/ipal-kit` | List of user agents of model-training crawlers (GPTBot, Google-Extended…). |
|
||||
| `robotsOptionsFrom(settings)` | `@intecion/ipal-kit` | Site Settings → Search & AI → AI crawlers as `buildRobots` options (`aiBots` unless the policy is `default`, `aiBotRules`; invalid user agents dropped). `getRobots` from `createContentHelpers` uses it — own robots: `buildRobots({ ...robotsOptionsFrom(settings), … })`. |
|
||||
| `robotsOptionsFrom(settings)` | `@intecion/ipal-kit` | Site settings → Search engines → AI assistants as `buildRobots` options (`aiBots` unless the policy is `default`, `aiBotRules`; invalid user agents dropped). `getRobots` from `createContentHelpers` uses it — own robots: `buildRobots({ ...robotsOptionsFrom(settings), … })`. |
|
||||
| `buildLlmsTxt({ payload, config, baseUrl, full?, content?, summaryField?, … })` | `@intecion/ipal-kit` | `/llms.txt` content (or `llms-full.txt` with `full`) from the panel, same rules as the sitemap. |
|
||||
| `createLlmsTxtRoute({ getCachedPayload, config, baseUrl, full?, … })` | `@intecion/ipal-kit` | Ready `GET` handler for `/llms.txt` / `/llms-full.txt`. Usually `llmsRoute` / `llmsFullRoute` from `createContentHelpers`. |
|
||||
| `collectSiteIndex({ payload, config, baseUrl?, content?, locales?, … })` | `@intecion/ipal-kit` | Shared index of public documents per language (URL, title, description, dates) — the source for llms.txt, MCP `list_pages`, IndexNow. Use it before you write your own site listing. |
|
||||
@@ -573,7 +579,7 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
|
||||
| `buildIndexNowHook({ config, contentCollection?, baseUrl?, settingsSlug? })` | `@intecion/ipal-kit` | `afterChange` hook: after publish, sends the URLs in all languages to IndexNow (in the background, production only). With `ipalKit({ indexNow: true })` the plugin wires it itself on pages and content collections — do not call. |
|
||||
| `submitToIndexNow({ payload, urls, baseUrl? })` | `@intecion/ipal-kit` | Manual POST of a batch of URLs to IndexNow; never throws, returns `boolean`. |
|
||||
| `createIndexNowKeyRoute({ getCachedPayload })` | `@intecion/ipal-kit` | `GET` handler for the key file (`/indexnow-key.txt`) for verification. Usually `indexNowKeyRoute` from `createContentHelpers`. |
|
||||
| `getIndexNowKey(payload)` | `@intecion/ipal-kit` | IndexNow key: env `INDEXNOW_KEY`, then Site Integrations; `''` when missing. |
|
||||
| `getIndexNowKey(payload)` | `@intecion/ipal-kit` | IndexNow key: env `INDEXNOW_KEY`, then Site integrations; `''` when missing. |
|
||||
| `INDEXNOW_KEY_ENV` | `@intecion/ipal-kit` | `'INDEXNOW_KEY'` — name of the env variable with the key. |
|
||||
| `INDEXNOW_KEY_PATH` | `@intecion/ipal-kit` | `'/indexnow-key.txt'` — path of the key file route. |
|
||||
|
||||
@@ -656,7 +662,7 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
|
||||
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getTurnstileConfig(payload)` | `@intecion/ipal-kit` | `{ enabled, siteKey }` from Site Integrations (env fallback); enabled only when both keys are set. In the server layout → `TurnstileProvider`. |
|
||||
| `getTurnstileConfig(payload)` | `@intecion/ipal-kit` | `{ enabled, siteKey }` from Site integrations (env fallback); enabled only when both keys are set. In the server layout → `TurnstileProvider`. |
|
||||
| `TurnstileProvider({ siteKey, children })` | `@intecion/ipal-kit/client` | Provides the site key to the whole app; with `siteKey` null the widgets render nothing. |
|
||||
| `useTurnstile()` | `@intecion/ipal-kit/client` | In a form: `{ token, TurnstileWidget, reset, … }`; pass the token to `submitForm`. Requires the provider. |
|
||||
| `useOptionalTurnstile()` | `@intecion/ipal-kit/client` | Like `useTurnstile`, but without a provider it returns `enabled: false` instead of throwing — for shared components. |
|
||||
|
||||
@@ -28,7 +28,7 @@ Checks the **running** app, not the code — exactly what Googlebot gets.
|
||||
| unknown URL returns 200 | no `notFound()` in the catch-all |
|
||||
| sitemap URLs not 200 | the sitemap lists redirecting addresses (old slugs) |
|
||||
| robots.txt points to localhost | `NEXT_PUBLIC_SERVER_URL` not set in the build |
|
||||
| no JSON-LD structured data | no `<SiteProviders>` / `<JsonLdGraph>` in `[locale]/layout.tsx`, or an empty name in Site Settings |
|
||||
| no JSON-LD structured data | no `<SiteProviders>` / `<JsonLdGraph>` in `[locale]/layout.tsx`, or an empty name in Site settings |
|
||||
| `/llms.txt` / `/llms-full.txt` → 404 | no route (`export { llmsRoute as GET }` / `llmsFullRoute` from `lib/content`) |
|
||||
| Markdown version `/md/…` → 404 | no `src/app/md/[locale]/[[...slug]]/route.ts`; the page is noindex/draft |
|
||||
| `sitemap.xml → 503` | database unreachable while building the sitemap (`sitemapRoute` returns 503 + Retry-After instead of an empty one) — check `DATABASE_URL` / database health |
|
||||
@@ -37,8 +37,8 @@ Checks the **running** app, not the code — exactly what Googlebot gets.
|
||||
|
||||
3. `no verification meta tag` (INFO — not counted as an error or warning) — with domain
|
||||
verification by DNS (recommended, docs/deployment.md §6) this is the correct state; do nothing. Only for
|
||||
URL-prefix verification, paste the code in **Site Settings → Search & AI**.
|
||||
`robots.txt blocks AI bots` — also check Site Settings → Search & AI → AI crawlers
|
||||
URL-prefix verification, paste the code in **Site settings → Search engines**.
|
||||
`robots.txt blocks AI bots` — also check Site settings → Search engines → AI assistants
|
||||
(when the project uses `getRobots`, the editor may have changed the policy).
|
||||
4. Judge each `[WARNING]`: a missing description / duplicate titles are **content in the panel** —
|
||||
fill them in from the brief or list them in the report for the client.
|
||||
|
||||
@@ -133,7 +133,7 @@ One language: one entry in `locales`, no `[locale]` folder (i18n.md).
|
||||
|
||||
**Check.** `pnpm payload generate:importmap` (whiteLabel adds admin components) and `pnpm generate:types` without
|
||||
errors; `pnpm dev`, `/admin`: first-user screen → after saving, TOTP setup is enforced (QR);
|
||||
the panel shows Site Settings, Site Integrations, Cookie Settings, Notifications, the Forms group, Consent records.
|
||||
the panel shows Site settings, Site integrations, Cookie banner, Notifications, the Forms group, Consent records.
|
||||
`curl -s -o /dev/null -w '%{http_code}' -X POST localhost:3000/api/ipal/consent -H 'content-type: application/json'
|
||||
-d '{"id":"0123456789abcdef","version":1,"state":{"necessary":true,"functional":false,"analytics":false,"marketing":false}}'` → `201`.
|
||||
|
||||
@@ -290,7 +290,7 @@ exports `route.Page`, `route.generateMetadata`, `route.generateStaticParams`.
|
||||
`notFoundView.ts` (`'use server'`, `loadNotFoundView(locale)` → `renderNotFoundView(content, { blocks: blockRegistry }, locale)`)
|
||||
and `not-found.tsx` (`export default createNotFoundPage(content, { load: loadNotFoundView })`) — both from `/rsc`, PROGRAMISTA §2.8.
|
||||
|
||||
**Check.** `curl -sI localhost:3000/ | grep -i location` → `/pl`; after stage 11 (Homepage in System Pages)
|
||||
**Check.** `curl -sI localhost:3000/ | grep -i location` → `/pl`; after stage 11 (Homepage in System pages)
|
||||
`curl -s -A Googlebot localhost:3000/pl | grep -o '<link rel="canonical"[^>]*>'` — in `<head>`, plus `hreflang`
|
||||
and `rel="alternate" type="text/markdown"`; `/pl/nie-ma-takiej` → 404 with content from the panel; `/admin` and `/_next` → no 500;
|
||||
`pnpm build` shows `●` (SSG) next to `[[...slug]]`.
|
||||
@@ -318,7 +318,7 @@ and `rel="alternate" type="text/markdown"`; `/pl/nie-ma-takiej` → 404 with con
|
||||
| File | Content |
|
||||
|---|---|
|
||||
| `src/app/sitemap.xml/route.ts` | `export { sitemapRoute as GET } from '@/lib/content'` + `export const dynamic = 'force-dynamic'` |
|
||||
| `src/app/robots.ts` | `export { getRobots as default } from '@/lib/content'` + `force-dynamic` (AI crawler policy from Site Settings → Search & AI; `robots` = code only) |
|
||||
| `src/app/robots.ts` | `export { getRobots as default } from '@/lib/content'` + `force-dynamic` (AI crawler policy from Site settings → Search engines; `robots` = code only) |
|
||||
| `src/app/manifest.ts` | `export { manifest as default } from '@/lib/content'` + `force-dynamic` |
|
||||
| `src/app/api/health/route.ts` | `export { healthRoute as GET } from '@/lib/content'` + `force-dynamic` |
|
||||
|
||||
@@ -355,8 +355,8 @@ export function register() {
|
||||
|
||||
**Check.** `curl -s localhost:3000/sitemap.xml | head` → `<urlset` with `xhtml:link hreflang`; in the browser
|
||||
the "XML Sitemap" style; `curl -s localhost:3000/robots.txt` → `Sitemap:`, `Disallow: /admin`, AI bots (GPTBot,
|
||||
ClaudeBot…) with `Allow` (a policy picked in Site Settings → Search & AI → AI crawlers shows up after a reload);
|
||||
`curl -sI localhost:3000/sitemap.xml | grep -i cache-control` → `s-maxage=3600`; `/manifest.webmanifest` → JSON with the name from Site Settings; `/api/health` → `200`
|
||||
ClaudeBot…) with `Allow` (a policy picked in Site settings → Search engines → AI assistants shows up after a reload);
|
||||
`curl -sI localhost:3000/sitemap.xml | grep -i cache-control` → `s-maxage=3600`; `/manifest.webmanifest` → JSON with the name from Site settings; `/api/health` → `200`
|
||||
(`503` without a database); `curl -sI localhost:3000/pl | grep -i 'x-frame-options\|content-security-policy-report-only'`;
|
||||
an empty `PAYLOAD_SECRET` in `.env` → `pnpm dev` exits with a list of missing variables (restore it).
|
||||
|
||||
@@ -365,16 +365,16 @@ an empty `PAYLOAD_SECRET` in `.env` → `pnpm dev` exits with a list of missing
|
||||
or your own text; `buildSecurityHeaders({ frameOptions, coop, hsts, additional })` — an `additional` entry with the same key
|
||||
overrides the default; CSP: `buildCsp` flags (`youtube`, `googleMaps`, `extra`), after a clean console `mode: 'enforce'`;
|
||||
`buildImagesConfig({ extraHosts })`; env validation is fully opt-in — filter/add rules
|
||||
(`ipalEnvRules(…).filter(…)`). Staging: `IPAL_NOINDEX=1` (also stops IndexNow). Search & AI: `robots` instead of
|
||||
(`ipalEnvRules(…).filter(…)`). Staging: `IPAL_NOINDEX=1` (also stops IndexNow). Search engines: `robots` instead of
|
||||
`getRobots` ignores the panel; `ipalKit({ searchSettings: false })` removes the tab; per-bot exceptions in code:
|
||||
`createContentHelpers({ robots: { aiBotRules: [{ userAgent, access }] } })`. Sitemap: `sitemapOptions: { maxUrls,
|
||||
cacheControl, memoSeconds }`, `sitemapEntries: (entries) => entries` (add/remove URLs), `underConstructionSeo: false`.
|
||||
|
||||
**Search & AI panel step.** Nothing in code — the tab exists by default. **Postgres:** after installing or upgrading
|
||||
**Search engines panel step.** Nothing in code — the tab exists by default. **Postgres:** after installing or upgrading
|
||||
the plugin run `pnpm payload migrate:create` (new columns `search_verification_*`, `ai_crawlers_policy`, the
|
||||
`ai_crawlers_rules` table, localized `llms_intro`) → `pnpm payload migrate`; SQLite/Mongo: nothing. Search Console:
|
||||
verify the **domain via DNS** (stage 11) and leave the verification fields empty; only for URL-prefix verification
|
||||
paste the code into Site Settings → Search & AI (never into code). `llmsIntro` (per language): 2–4 sentences of facts
|
||||
paste the code into Site settings → Search engines (never into code). `llmsIntro` (per language): 2–4 sentences of facts
|
||||
from the brief (who, what, where, since when, for whom) — it goes at the top of `/llms.txt`. Check:
|
||||
`curl -s localhost:3000/llms.txt | head` (the note under the description).
|
||||
|
||||
@@ -410,16 +410,16 @@ list is currently fixed; block Markdown: `markdown: { overrides }` in `createCon
|
||||
**Steps.** Skill **ipal-form**: a block with `<RenderForm>` (`/rsc`), `src/components/forms/formClasses.ts`, the action from stage 6
|
||||
(one per project), every form from a **seed** `scripts/seed-form-*.ts` (email to the company + confirmation to the customer,
|
||||
every language, consent checkbox). Cookies: skill **ipal-consent-check** — `cookie-scan.mjs` → `import-cookies.ts` into
|
||||
Cookie Settings → Cookies; on the cookie policy page a block with `<CookieTable>` (`/rsc`, data from `getCookieTable`);
|
||||
the same list appears in the `settings="detailed"` dialog (labels: Cookie Settings → Detail labels, every language).
|
||||
Cookie banner → Cookie list; on the cookie policy page a block with `<CookieTable>` (`/rsc`, data from `getCookieTable`);
|
||||
the same list appears in the `settings="detailed"` dialog (labels: Cookie banner → Settings window → Cookie list headings, every language).
|
||||
|
||||
**Check.** Panel → Forms: the seeded form; a submission on `/pl` → an entry in Form Submissions + 2 emails (SMTP:
|
||||
Site Integrations → SMTP → Send test); with Turnstile test keys the widget is visible, without a token the submission is rejected;
|
||||
Site integrations → SMTP → Send test); with Turnstile test keys the widget is visible, without a token the submission is rejected;
|
||||
`node .agents/skills/ipal-consent-check/scripts/consent-check.mjs http://localhost:3000/pl` = 0 errors;
|
||||
after a choice in the banner a new record in Consent records.
|
||||
|
||||
**Turn off / override.** Turnstile: both keys empty (panel and env) → no widget and no verification; fail-closed
|
||||
`turnstileOnConfigError: 'reject'`; the Turnstile/SMTP fields in Site Integrations currently always. Form look:
|
||||
`turnstileOnConfigError: 'reject'`; the Turnstile/SMTP fields in Site integrations currently always. Form look:
|
||||
`formClasses`, unusual ones → `useBuilderForm` (no copy of the engine). Banner: `settings`, `controls`, `order`,
|
||||
`equalChoice`, `classNames`, tokens; no `consentLog` = no register and no endpoint (then remove `logEndpoint`).
|
||||
**Consent Mode choice** (record it in "Project decisions"): `'advanced'` (default) — the Google tag loads at once with
|
||||
@@ -428,7 +428,7 @@ no request to `googletagmanager.com` before analytics or marketing consent (a cl
|
||||
Check in `basic`: DevTools → Network shows no `gtm.js` / `gtag/js` before consent. Analytics: empty IDs in the panel or
|
||||
`analytics={false}`. Forms: `createSubmitAction({ turnstileHostnames: ['client.pl'] })` rejects a token solved on
|
||||
another domain (leave it empty in dev — Cloudflare test keys report `example.com`). The locale cookie respects consent;
|
||||
after an editor bumps Cookie Settings → Policy version nothing to change (`createProxy(config, { policyVersion })` pins one).
|
||||
after an editor bumps Cookie banner → Policy version nothing to change (`createProxy(config, { policyVersion })` pins one).
|
||||
|
||||
## 10. Navigation
|
||||
|
||||
@@ -470,14 +470,14 @@ scaling (5). `●` routes for pages need the database at build time (PROGRAMISTA
|
||||
|
||||
**Panel steps for the user** (`/admin`, paste them this list with the gaps from the report):
|
||||
1. First user with the **admin** role + 2FA setup (TOTP app).
|
||||
2. **Site Settings → General**: site name, logo, favicon (PNG), description.
|
||||
2. **Site settings → General**: site name, logo, favicon (PNG), description.
|
||||
3. **Pages**: home page (title and slug **in every language**, otherwise `/en` → 404), 404, privacy policy,
|
||||
cookie policy (with the `CookieTable` block), terms if needed; `noindex` on the policies; AI summary.
|
||||
4. **Site Settings → System Pages**: Homepage (without it `/pl` → 404), 404, policies; content collection archives.
|
||||
5. **Cookie Settings**: banner texts, Privacy link label, Policy version, Cookies (import from the scan), Detail labels —
|
||||
4. **Site settings → System pages**: Homepage (without it `/pl` → 404), 404, policies; content collection archives.
|
||||
5. **Cookie banner**: banner texts, Privacy link label, Policy version, Cookies (import from the scan), Detail labels —
|
||||
in every language.
|
||||
6. **Notifications**: form messages in every language.
|
||||
7. **Site Integrations**: SMTP or Graph (From Name/Address; Send test), Turnstile (for testing site
|
||||
7. **Site integrations**: SMTP or Graph (From Name/Address; Send test), Turnstile (for testing site
|
||||
`1x00000000000000000000AA`, secret `1x0000000000000000000000000000000AA`; production keys from the client), analytics/pixel
|
||||
IDs, IndexNow → generate key. Mail/Turnstile errors show up as a dashboard alert.
|
||||
8. **Forms**: check the addresses in the Emails tab of the seeded forms.
|
||||
@@ -515,7 +515,7 @@ prepare the list with values, a human adds them, you verify with `dig`). Full ta
|
||||
From domain: SMTP from the panel → the domain of the *From address* (records from the mailbox provider); Graph → From is
|
||||
always `GRAPH_SENDER` (agency domain, set once — nothing in the project). After DNS: *Send test* and in the received
|
||||
email `Authentication-Results: spf=pass dkim=pass dmarc=pass`. We verify Search Console **via DNS** —
|
||||
the verification fields in Site Settings → Search & AI stay **empty** (only URL-prefix verification uses them; the plugin then adds the `<meta>` itself); submit the sitemap `https://client.pl/sitemap.xml`
|
||||
the verification fields in Site settings → Search engines stay **empty** (only URL-prefix verification uses them; the plugin then adds the `<meta>` itself); submit the sitemap `https://client.pl/sitemap.xml`
|
||||
once by hand in GSC and Bing (no API). Turnstile, IndexNow, llms, MCP — no DNS.
|
||||
|
||||
Final report: what is wired, what is missing (data, keys, decisions), the DNS record list with values (`dig` status), every `ipal-audit-skip`, any
|
||||
|
||||
@@ -28,7 +28,7 @@ between phases. Before each phase, go through the "Anticipate" table in AGENT.md
|
||||
4. Which address should form submissions go to? (without it the form seed won't run — the only question without which I can't deliver forms)
|
||||
5. Analytics: GA4/GTM/pixel IDs? (off until the IDs are entered in the panel)
|
||||
6. R2 details: bucket, endpoint, keys, media domain? (R2 is always wired; until the keys arrive, media stay local in dev)
|
||||
7. Turnstile keys? (test keys in dev; you'll enter production keys in Site Integrations)
|
||||
7. Turnstile keys? (test keys in dev; you'll enter production keys in Site integrations)
|
||||
8. AI access to content (llms.txt, Markdown, MCP, AI bots)? (on — I turn it off only at your explicit request)
|
||||
9. Translations: should I make drafts for approval? (yes, marked in the report)
|
||||
```
|
||||
@@ -44,7 +44,7 @@ between phases. Before each phase, go through the "Anticipate" table in AGENT.md
|
||||
|
||||
## Phase 2 — Content model
|
||||
- Pages = `Pages` + blocks. Collections only for lists with URLs (**ipal-collection**).
|
||||
- Globals: Header, Footer, Company (**ipal-nav**), Site Settings, System Pages.
|
||||
- Globals: Header, Footer, Company (**ipal-nav**), Site settings, System pages.
|
||||
- Every section from the site map → an existing block, a variant of an existing one (`variant`)
|
||||
or a new block. Goal: as few blocks as possible, as many variants as possible.
|
||||
- Schema change with content in the database → **ipal-migrate-fields**, never "live".
|
||||
@@ -58,7 +58,7 @@ Every block: schema from the field dictionary, composition of primitives, zero t
|
||||
**Enlarged images** (gallery, cards, product photos, certificates, rich text): the shared lightbox,
|
||||
never a hand-made modal or a lightbox library — `ipalKit({ lightbox: true })` + migration,
|
||||
`<SiteProviders lightbox>` once, `<LightboxTrigger group={`gallery-${id}`} image={lightboxImage(media, { size })}>`
|
||||
around the thumbnail, `RenderRichText lightbox` for article images, Notifications → Lightbox labels
|
||||
around the thumbnail, `RenderRichText lightbox` for article images, Form messages → Image viewer labels
|
||||
in every language (lightbox.md). Check with the keyboard: Enter opens, ←/→ browse, Esc returns focus.
|
||||
|
||||
## Phase 5 — Forms → **ipal-form**
|
||||
@@ -77,18 +77,18 @@ form with fields in JSX, an `api/contact` route, `nodemailer`, reCAPTCHA (AGENT.
|
||||
On production (rules: `node_modules/@intecion/ipal-kit/docs/seeding.md`): `SEED_DRY_RUN=1` first, back up the
|
||||
database, then the real run. It only creates what is missing; `SEED_UPDATE=1` there is refused without
|
||||
`IPAL_SEED_ALLOW_PROD_UPDATE=1` and still skips pages an editor changed (`skip (edited)`).
|
||||
3. System Pages: Homepage, 404, privacy policy (the page exists; the policy
|
||||
text comes from the client → placeholder). Cookie Settings (with Detail labels and the Cookies list
|
||||
3. System pages: Homepage, 404, privacy policy (the page exists; the policy
|
||||
text comes from the client → placeholder). Cookie banner (with Detail labels and the Cookies list
|
||||
from the scan), Notifications — texts in every language.
|
||||
4. **ipal-locale-add → `locale-coverage`** = 0 gaps (or deliberate ones listed in the report).
|
||||
5. Images: leave upload fields empty (the editor adds them) or upload files from
|
||||
the brief via the panel — prepared (WebP/JPG ≤ 1.5 MB, ≤ 2560 px).
|
||||
|
||||
## Phase 7 — Integrations (panel, not code)
|
||||
Site Integrations: email transport + **Send test**, Turnstile (both keys — one
|
||||
Site integrations: email transport + **Send test**, Turnstile (both keys — one
|
||||
key = Turnstile off and a red alert on the dashboard), analytics/pixels
|
||||
(only with IDs from the client), consent (categories matching the tools in use).
|
||||
Site Settings: name, description (feeds llms.txt and MCP), OG image, favicon. SEO tab: meta
|
||||
Site settings: name, description (feeds llms.txt and MCP), OG image, favicon. SEO tab: meta
|
||||
title/description of every page (≤ 60 / ≤ 155 characters, unique); `aiSummary` —
|
||||
keep the auto-fill or fix it when the summary is weak.
|
||||
|
||||
|
||||
@@ -47,25 +47,25 @@ a custom RenderBlocks for `h1` (→ `isFirst`). Links to posts: `buildLinkField(
|
||||
`NEXT_RUNTIME` condition around the `revalidatePath` injected into `buildRevalidateHook` (a global's own `afterChange` hook keeps it — ipal-nav), the form focus guard, a custom theme (→ `ThemeScript`/`ThemeSwitcher`),
|
||||
a custom table of contents (→ `extractHeadings` + `TableOfContents` + `headingIds`), catching `notFound` for a redirect
|
||||
(→ `onMissing: 'redirectHome'`), background colour only for JPEG in `<Media>`, a custom type instead of `CmsLink['appearance']`
|
||||
(→ per-shape types from `generate:types`: `CmsLink`, `CmsLinkPlain`, `CmsLinkNoLabel`, `CmsLinkPlainNoLabel`; style: `LinkAppearance`). Cookie Settings: `buttons.save` →
|
||||
(→ per-shape types from `generate:types`: `CmsLink`, `CmsLinkPlain`, `CmsLinkNoLabel`, `CmsLinkPlainNoLabel`; style: `LinkAppearance`). Cookie banner: `buttons.save` →
|
||||
`buttons.savePreferences` — in `migrate:create` choose **rename** for the column to keep the texts.
|
||||
|
||||
**→ 1.12.3 (PROGRAMISTA §6, item 46):** Postgres/SQLite: `migrate:create` (new Cookie Settings group →
|
||||
**→ 1.12.3 (PROGRAMISTA §6, item 46):** Postgres/SQLite: `migrate:create` (new Cookie banner group →
|
||||
`detailLabels`, only new columns — no rename). A custom cookie settings window or a cookie list added to
|
||||
the banner → `<CookieBanner settings="detailed">` and remove the copy. With `detailed`: Cookie Settings → Cookies filled in
|
||||
the banner → `<CookieBanner settings="detailed">` and remove the copy. With `detailed`: Cookie banner → Cookie list filled in
|
||||
(scan, **ipal-consent-check**) and Detail labels in every language.
|
||||
|
||||
**→ 1.13.0 (PROGRAMISTA §6, item 47; CHANGELOG "What projects must update" — do all 7, in order):**
|
||||
1. **Project without `access`** (no `roles` field): every logged-in account can now use the plugin's admin and editor
|
||||
features (Site Integrations, settings globals, test e-mail, stats, consent records, forms, form submissions); before,
|
||||
features (Site integrations, settings globals, test e-mail, stats, consent records, forms, form submissions); before,
|
||||
nobody could through the API. Check who can log in (`grep -rn "auth:" src/collections`, open sign-up, customer
|
||||
accounts). Untrusted accounts → add `access` (roles), or narrow with `globalOverrides`, `forms.formOverrides` /
|
||||
`forms.formSubmissionOverrides`, `consentLog.collectionOverrides`, `stats.collectionOverrides`. Verify: log in as a
|
||||
non-staff account → `GET /api/globals/site-integrations` is 403.
|
||||
2. **Project with `access`:** plain `user` accounts can no longer edit Site Settings, Cookie Settings, Notifications or
|
||||
2. **Project with `access`:** plain `user` accounts can no longer edit Site settings, Cookie banner, Notifications or
|
||||
forms, or create/delete users. List staff accounts in the panel (Users → Roles) and give them `editor` / `admin`, or
|
||||
loosen with `globalOverrides`, `forms.formOverrides.access`, `access.authAccess`. Verify: an editor saves Site Settings.
|
||||
3. **Postgres/SQLite:** `pnpm payload migrate:create` → `migrate` (Site Settings → Search & AI:
|
||||
loosen with `globalOverrides`, `forms.formOverrides.access`, `access.authAccess`. Verify: an editor saves Site settings.
|
||||
3. **Postgres/SQLite:** `pnpm payload migrate:create` → `migrate` (Site settings → Search engines:
|
||||
`search_verification_*`, `ai_crawlers_policy`, the `ai_crawlers_rules` table, localized `llms_intro`). With
|
||||
`enabled: false` the migration now keeps (or restores) the plugin's tables — check it has no DROP TABLE. MongoDB: nothing.
|
||||
4. `pnpm payload generate:importmap`, `pnpm ipal:skills`, `rm -rf .next`.
|
||||
@@ -75,7 +75,7 @@ the banner → `<CookieBanner settings="detailed">` and remove the copy. With `d
|
||||
startup (`allowCollectionMismatch: true`); requests without a client IP share one limited bucket (proxy hides the IP
|
||||
→ `IPAL_IP_HEADER`, or `setUnknownIpFactor`); `RenderRichText` turns unsafe link URLs into `#` (`safeLinks`).
|
||||
6. **Review the new options with the user** (AGENT.md §7.1): `consentMode: 'basic'`, `revalidatePath`,
|
||||
`turnstileHostnames`, Site Settings → Search & AI (verification codes, or keep DNS verification), `app/robots.ts` →
|
||||
`turnstileHostnames`, Site settings → Search engines (verification codes, or keep DNS verification), `app/robots.ts` →
|
||||
`export { getRobots as default }` + `force-dynamic`, `createSearchRoute({ …, isPathVisible })`, `access.firstUserAdmin`.
|
||||
7. **Remove the workarounds:** a plugin after `ipalKit` that adds `afterChange` or access to the plugin globals →
|
||||
`ipalKit({ revalidatePath })` / `globalOverrides`; a hand-written global revalidation hook →
|
||||
|
||||
Reference in New Issue
Block a user