diff --git a/dev/payload-types.ts b/dev/payload-types.ts index 12fa8d5..46dd43d 100644 --- a/dev/payload-types.ts +++ b/dev/payload-types.ts @@ -71,6 +71,8 @@ export interface Config { pages: Page; posts: Post; media: Media; + forms: Form; + 'form-submissions': FormSubmission; 'payload-kv': PayloadKv; 'payload-locked-documents': PayloadLockedDocument; 'payload-preferences': PayloadPreference; @@ -82,6 +84,8 @@ export interface Config { pages: PagesSelect | PagesSelect; posts: PostsSelect | PostsSelect; media: MediaSelect | MediaSelect; + forms: FormsSelect | FormsSelect; + 'form-submissions': FormSubmissionsSelect | FormSubmissionsSelect; 'payload-kv': PayloadKvSelect | PayloadKvSelect; 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; 'payload-preferences': PayloadPreferencesSelect | PayloadPreferencesSelect; @@ -223,6 +227,188 @@ export interface Post { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "forms". + */ +export interface Form { + id: number; + title: string; + fields?: + | ( + | { + name: string; + label?: string | null; + width?: number | null; + required?: boolean | null; + defaultValue?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'checkbox'; + } + | { + name: string; + label?: string | null; + width?: number | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'country'; + } + | { + name: string; + label?: string | null; + width?: number | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'email'; + } + | { + message?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + id?: string | null; + blockName?: string | null; + blockType: 'message'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: number | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'number'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: string | null; + placeholder?: string | null; + options?: + | { + label: string; + value: string; + id?: string | null; + }[] + | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'select'; + } + | { + name: string; + label?: string | null; + width?: number | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'state'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: string | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'text'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: string | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'textarea'; + } + )[] + | null; + submitButtonLabel?: string | null; + confirmationType?: ('message' | 'redirect') | null; + confirmationMessage?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + redirect?: { + url: string; + }; + emails?: + | { + emailTo?: string | null; + cc?: string | null; + bcc?: string | null; + replyTo?: string | null; + emailFrom?: string | null; + subject: string; + message?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + id?: string | null; + }[] + | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "form-submissions". + */ +export interface FormSubmission { + id: number; + form: number | Form; + submissionData?: + | { + field: string; + value: string; + id?: string | null; + }[] + | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-kv". @@ -262,6 +448,14 @@ export interface PayloadLockedDocument { | ({ relationTo: 'media'; value: number | Media; + } | null) + | ({ + relationTo: 'forms'; + value: number | Form; + } | null) + | ({ + relationTo: 'form-submissions'; + value: number | FormSubmission; } | null); globalSlug?: string | null; user: { @@ -380,6 +574,155 @@ export interface MediaSelect { focalX?: T; focalY?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "forms_select". + */ +export interface FormsSelect { + title?: T; + fields?: + | T + | { + checkbox?: + | T + | { + name?: T; + label?: T; + width?: T; + required?: T; + defaultValue?: T; + id?: T; + blockName?: T; + }; + country?: + | T + | { + name?: T; + label?: T; + width?: T; + required?: T; + id?: T; + blockName?: T; + }; + email?: + | T + | { + name?: T; + label?: T; + width?: T; + required?: T; + id?: T; + blockName?: T; + }; + message?: + | T + | { + message?: T; + id?: T; + blockName?: T; + }; + number?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + required?: T; + id?: T; + blockName?: T; + }; + select?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + placeholder?: T; + options?: + | T + | { + label?: T; + value?: T; + id?: T; + }; + required?: T; + id?: T; + blockName?: T; + }; + state?: + | T + | { + name?: T; + label?: T; + width?: T; + required?: T; + id?: T; + blockName?: T; + }; + text?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + required?: T; + id?: T; + blockName?: T; + }; + textarea?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + required?: T; + id?: T; + blockName?: T; + }; + }; + submitButtonLabel?: T; + confirmationType?: T; + confirmationMessage?: T; + redirect?: + | T + | { + url?: T; + }; + emails?: + | T + | { + emailTo?: T; + cc?: T; + bcc?: T; + replyTo?: T; + emailFrom?: T; + subject?: T; + message?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "form-submissions_select". + */ +export interface FormSubmissionsSelect { + form?: T; + submissionData?: + | T + | { + field?: T; + value?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-kv_select". @@ -450,6 +793,15 @@ export interface SiteSetting { * Fallback Open Graph image when a page has none. */ defaultShareImage?: (number | null) | Media; + /** + * Official profiles of this business (Google Business Profile, LinkedIn, Facebook, Wikipedia…). Tells search engines and AI which entity the site belongs to. + */ + sameAs?: + | { + url: string; + id?: string | null; + }[] + | null; /** * Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata. */ @@ -539,6 +891,10 @@ export interface SiteIntegration { since?: string | null; checkedAt?: string | null; }; + /** + * Key that proves this site owns its URLs to IndexNow (Bing, ChatGPT Search). Generated automatically — change only to rotate it. + */ + indexNowKey?: string | null; updatedAt?: string | null; createdAt?: string | null; } @@ -548,6 +904,10 @@ export interface SiteIntegration { */ export interface CookieSetting { id: number; + /** + * Raise by 1 when you add a tool or change the cookie policy — every visitor is asked for consent again. + */ + policyVersion: number; /** * Main consent message shown in the banner. */ @@ -581,6 +941,25 @@ export interface CookieSetting { id?: string | null; }[] | null; + /** + * Cookies the site uses — shown on the cookie policy page (). Fill it from a scan: ipal-consent-check → cookie-scan. + */ + cookies?: + | { + name: string; + /** + * e.g. Google, this site + */ + provider?: string | null; + category: 'necessary' | 'functional' | 'analytics' | 'marketing'; + purpose?: string | null; + /** + * e.g. "2 years", "session" + */ + duration?: string | null; + id?: string | null; + }[] + | null; updatedAt?: string | null; createdAt?: string | null; } @@ -622,6 +1001,12 @@ export interface SiteSettingsSelect { titleSeparator?: T; logo?: T; defaultShareImage?: T; + sameAs?: + | T + | { + url?: T; + id?: T; + }; favicon?: T; defaultTheme?: T; allowThemeToggle?: T; @@ -667,6 +1052,7 @@ export interface SiteIntegrationsSelect { since?: T; checkedAt?: T; }; + indexNowKey?: T; updatedAt?: T; createdAt?: T; globalType?: T; @@ -676,6 +1062,7 @@ export interface SiteIntegrationsSelect { * via the `definition` "cookie-settings_select". */ export interface CookieSettingsSelect { + policyVersion?: T; message?: T; settingsTitle?: T; privacyLinkLabel?: T; @@ -696,6 +1083,16 @@ export interface CookieSettingsSelect { description?: T; id?: T; }; + cookies?: + | T + | { + name?: T; + provider?: T; + category?: T; + purpose?: T; + duration?: T; + id?: T; + }; updatedAt?: T; createdAt?: T; globalType?: T; diff --git a/dev/payload.config.ts b/dev/payload.config.ts index c73cc56..a29b654 100644 --- a/dev/payload.config.ts +++ b/dev/payload.config.ts @@ -63,6 +63,8 @@ export default buildConfig({ { code: 'en', label: 'English' }, ], }, + consentLog: true, + forms: {}, seo: { collections: ['posts', 'pages'] }, // 2FA is enforced by default; the dev sandbox opts out so it boots without an authenticator. twoFactor: false, diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9d7a44b..767a7e3 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,43 @@ Zmiany ważne dla projektów na ipal-kit. Jak przejść na nową wersję: skill **ipal-upgrade** i [PROGRAMISTA.md §6](./dev/PROGRAMISTA.md). +## 1.9.1 + +### Wymaga zmian w projekcie +- **Bezpieczeństwo — drafty:** nigdy nieopublikowane strony i wpisy były dostępne pod swoim adresem + (oraz w Markdown, MCP, na listach archiwum). Teraz nie są. Podgląd redaktora: `draft: true` + w `resolveRoute` / `getArchiveEntries` w trybie `draftMode()`. +- **Zgłoszenia formularzy** czytają tylko role `editor`/`admin` (wcześniej każde konto panelu); + adresy odbiorców (zakładka Emails) zniknęły z publicznego `GET /api/forms`. +- **Formularze:** pole `email` przyjmuje dokładnie jeden adres, select tylko opcje z panelu, typy + sprawdzane po stronie serwera (`kind: 'invalid_format'`). Formularz wysyłający dane w innym kształcie + zostanie odrzucony. +- **Wycofanie zgody kasuje ciasteczka narzędzi** (`_ga*`, `_fbp`, `_gcl_*`, Clarity, LinkedIn…), także + na domenie nadrzędnej. +- **Nowe pola w globalach** (Postgres: `pnpm payload migrate:create`): Site Settings → sameAs; Cookie + Settings → Policy version, Cookies; Site Integrations → IndexNow. +- **Eksporty:** `@intecion/ipal-kit/env` i `/fluid.css` w końcu działają (były w docs, nie w paczce). +- **`users`:** plugin dodaje kolekcję auth, gdy projekt jej nie ma — usuń obejścia z `payload.config`. +- Komplet AGENT.md §0b rozszerzony do 18 pozycji (`ipal-audit` zgłosi braki). + +### Nowe +- SEO/GEO: `getPageJsonLd`, `buildNavigationJsonLd`, `formatOpeningHours` + `type` w + `buildLocalBusinessJsonLd`, `sameAsUrls`, IndexNow (`indexNow: true`, `createIndexNowKeyRoute`), + `collectSiteIndex` (blog i wszystkie języki w llms.txt i MCP), URL + data w frontmatterze Markdown, + karta X/Twitter, `og:type=article`, obrazy w sitemapie, domyślny obraz udostępniania działa. +- Gotowe trasy i akcje: `createMarkdownRoute`, `createSubmitAction`, `createProxy({ markdown: true })`. +- Zgoda: wersja polityki z panelu, `equalChoice`, rejestr zgód (`consentLog`), tabela ciasteczek + (`getCookieTable`, ``), skaner `cookie-scan` + import do panelu. +- noindex: `IPAL_NOINDEX=1` dla stagingu, Markdown/llms z `X-Robots-Tag: noindex` i canonical, + blokada noindex na stronie głównej i archiwach. +- Media: `mediaImageProps`, `videoProps`, `MEDIA_SIZES`, placeholdery przy uploadzie, + `buildImagesConfig`, ``, `buildUploadSecurityHeaders`. +- Skalowanie: `fluid-wide.css` (do 1920 px) i zmienne zależne od wysokości ekranu. +- `safeHref` (linki z CMS bez `javascript:`), walidacja ID analityki, pełny preset CSP Google Maps. +- Agent: AGENT.md §0c (treść pod Google i AI, kiedy noindex), §6.0 (zasady komponentu), §6.11a/b + (skalowanie, Core Web Vitals), §8a (testy) + szablon `smoke.spec.ts`; seed formularza; nowe + kontrole w `ipal-audit` i `ipal-seo-check`. + ## 1.9.0 ### Wymaga zmian w projekcie diff --git a/docs/agent/AGENT.md b/docs/agent/AGENT.md index 40e2564..67fb361 100644 --- a/docs/agent/AGENT.md +++ b/docs/agent/AGENT.md @@ -23,7 +23,7 @@ 3. **Next 16 = `proxy.ts`.** NIGDY `middleware.ts`. 4. **Bez jawnego ``, z ISR i `generateStaticParams`** — inaczej metadata ląduje w `` i SEO pada. -5. **Minimum kolekcji.** Users są wbudowane, dane firmy/nawigacja to globale, +5. **Minimum kolekcji.** Users wstrzykuje ipalKit, dane firmy/nawigacja to globale, FAQ/hero to bloki. 6. **Sekcja = kompozycja prymitywów.** `buildLinksField()` + ``, upload + ``, `
` + ``. Zero pól `ctaLabel`/`pdfUrl`. @@ -55,19 +55,21 @@ strona), **P** = test w panelu. Pełny kod: PROGRAMISTA.md §2. | 1 | i18n + routing | `src/proxy.ts`, `[locale]/[[...slug]]/page.tsx` z ISR + `generateStaticParams`, `not-found.tsx` | `createProxy`, `createContentHelpers`, `resolveRoute`, `resolveRedirect` | A, S | | 2 | **SEO** — meta | `generateMetadata` w każdej trasie stron; favicon i OG z Site Settings; `htmlLimitedBots` w `next.config.ts`; tab SEO + `buildNoindexField` w Pages | `generatePageMetadata`, `buildIconsMetadata`, `buildNoindexField` | A, S | | 3 | **SEO** — mapy | `src/app/sitemap.xml/route.ts`, `src/app/robots.ts`, `src/app/manifest.ts` (wszystkie z `force-dynamic` poza robots) | `sitemapRoute`, `robots`, `createManifestHandler` | A, S | -| 4 | **SEO** — dane strukturalne | `` w `[locale]/layout.tsx`: `WebSite` + `Organization` (lub `LocalBusiness` dla firmy lokalnej) z danych z panelu; `Breadcrumb` na podstronach; `FAQPage` przy bloku FAQ | `build*JsonLd`, `JsonLdGraph` (`/rsc`) | A, S | +| 4 | **SEO** — dane strukturalne | layout: `` z `WebSite` + `Organization` (`sameAs: sameAsUrls(settings)`) lub `LocalBusiness` (`type`, godziny tekstem z panelu → `formatOpeningHours`) + nawigacja `buildNavigationJsonLd(header)`; strona: `` (WebPage/BlogPosting, okruszki, FAQ) | `build*JsonLd`, `getPageJsonLd`, `JsonLdGraph` (`/rsc`) | A, S | | 5 | **GEO** — llms | `src/app/llms.txt/route.ts` i `src/app/llms-full.txt/route.ts` (`full: true`); pole `buildSummaryField()` w Pages, `summaryField: 'aiSummary'` w trasach AI | `createLlmsTxtRoute`, `buildSummaryField` | A, S | -| 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts`; `createContentHelpers({ markdownAlternate: true })` (link w ``); `createProxy(…, { NextResponse, markdown: true })` (bez tego `/md/…` dostaje redirect na język) | `createMarkdownRenderer`, `markdownResponse`, `markdownAlternate`, `createProxy({ markdown })` | A, S | +| 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts` = `export const { GET } = createMarkdownRoute({…})`; `createContentHelpers({ markdownAlternate: true })` (link w ``); `createProxy(…, { NextResponse, markdown: true })` (bez tego `/md/…` dostaje redirect na język) | `createMarkdownRoute`, `markdownAlternate`, `createProxy({ markdown })` | A, S | | 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` (publiczny — AI przegląda stronę: `get_site_info`, `list_pages`, `search_content`, `get_page`) | `createMcpRoute` | A, S | -| 8 | **GEO** — boty AI | robots **wpuszcza** boty AI (domyślne `aiBots: 'allow'`); `'block-training'` / `'disallow'` tylko z decyzji klienta | `buildRobots` | S | -| 9 | **Media / R2** | `Media` z `normalizeFilenameHook` + `buildOptimizeUploadHook`; **zawsze** `buildR2Storage(['media'], { s3Storage })` w `payload.config.ts` + `@payloadcms/storage-s3` w zależnościach; `R2_*` w `.env.example`; `` w layoutcie | `buildR2Storage`, `normalizeFilenameHook`, `MediaPreconnect` | A | -| 10 | **Formularze** | formularze w panelu (kolekcja Forms); jeden `FormRenderer` + jedna akcja `sendForm` → `submitForm`; `forms: {…}` w `ipalKit`; `email: mailAdapter()` | `submitForm`, `useForm`, `isHoneypotTripped`, `mailAdapter` | A, P | +| 8 | **GEO** — boty AI + IndexNow | robots **wpuszcza** boty AI (domyślne `aiBots: 'allow'`; blokada tylko z decyzji klienta); `ipalKit({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (publikacja → Bing/ChatGPT Search w minuty) | `buildRobots`, `createIndexNowKeyRoute` | A, S | +| 9 | **Media / R2 / szybkość** | `Media` z `focalPoint`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` + pole; **zawsze** `buildR2Storage(['media'], { s3Storage })` + `@payloadcms/storage-s3`; `R2_*` w `.env.example`; ``; `images: buildImagesConfig()` i `buildUploadSecurityHeaders()` w `next.config.ts`; `` projektu przez `mediaImageProps`/`videoProps` (§6.11b) | `buildR2Storage`, `mediaImageProps`, `videoProps`, `buildImagesConfig` | A, S | +| 10 | **Formularze** | każdy formularz z **seeda** (`scripts/seed-form-*.ts`: pola, potwierdzenie, mail do firmy **i** potwierdzenie do klienta, każdy język); jeden `FormRenderer`; `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` w `ipalKit`; `email: mailAdapter()` | `createSubmitAction`, `useForm`, `mailAdapter` | A, P | | 11 | **Turnstile** | `` w `[locale]/layout.tsx`, `siteKey` z `getTurnstileConfig(payload)`; widget w `FormRenderer` (`useTurnstile`); klucze w Site Integrations | `getTurnstileConfig`, `TurnstileProvider`, `useTurnstile` | A, P | -| 12 | Zgoda + analityka | `ConsentProvider`, `CookieBanner`, `CookieButton`, `Analytics` w layoutcie; ID narzędzi w panelu | consent.md, analytics.md | A, `ipal-consent-check` | +| 12 | Zgoda + analityka | `ConsentProvider` (`logEndpoint` przy `consentLog: true`), `CookieBanner equalChoice`, `CookieButton`, `Analytics` w layoutcie; ID narzędzi w panelu; lista ciasteczek ze skanu (cookie-scan → import) + `` na stronie polityki cookies | consent.md, analytics.md | A, `ipal-consent-check` | | 13 | Bezpieczeństwo | `buildSecurityHeaders` w `next.config.ts`; `twoFactor: { issuer, plugin: payloadTotp }`; CSP `report-only` → `enforce`; `IPAL_IP_HEADER` na produkcji | security.md, forms.md | A | -| 14 | Operacje | `src/app/api/health/route.ts`; `src/instrumentation.ts` z `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))` | `createHealthRoute`, `assertEnv`, `ipalEnvRules` | A | +| 14 | Operacje | `src/app/api/health/route.ts`; `src/instrumentation.ts` z `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))`; staging z `IPAL_NOINDEX=1`; testy smoke (§8a) | `createHealthRoute`, `assertEnv`, `ipalEnvRules` | A | | 15 | Strony systemowe | Site Settings → System Pages: homepage, 404, polityka prywatności, cookies; linki prawne w stopce przez rolę | `getSystemPagePath`, `getNotFoundPage` | P | | 16 | **Zero hardkodów** | każdy tekst, link, obraz, plik, dane firmy z panelu; domeny i klucze z `.env` (§2) | — | A, P | +| 17 | **Treść** | jedno h1, odpowiedź na początku sekcji, fakty, linki wewnętrzne, FAQ z prawdziwych pytań, `aiSummary`, sameAs, spójne dane firmy (§0c) | — | S, P | +| 18 | **Skalowanie** | `fluid.css` / `fluid-wide.css`, hero na `--ipal-hero-min-h`, lista ekranów §6.11a (w tym 1366×768) | — | A, przeglądarka | **Turnstile działa sam:** oba klucze w panelu (lub env) → widget się pokazuje, a `submitForm` **wymaga** tokenu; brak kluczy → widgetu nie ma, formularz działa. @@ -96,7 +98,63 @@ W `AGENTS.md` projektu, w „Ustaleniach”, jedna linia z kluczami pozycji i po ipal-audit-skip: mcp, llms-full — klient nie chce udostępniać treści agentom AI (mail 2026-03-02) ``` Klucze: `llms`, `llms-full`, `markdown`, `mcp`, `jsonld`, `r2`, `turnstile`, -`analytics`, `csp`, `twofactor`. Bez tej linii brak pozycji to błąd. +`analytics`, `csp`, `twofactor`, `aibots`, `forms-seed`. Bez tej linii brak pozycji to błąd. + +--- + +## 0c. TREŚĆ POD GOOGLE I AI (SEO + GEO) — jak piszesz i układasz strony + +Technika z §0b sprawia, że strona *może* być dobrze widoczna. To, czy Google ją +wypozycjonuje, a asystent AI zacytuje, zależy od treści. Wpisując treść z briefu do +panelu (seed, faza 6 w ipal-site), stosujesz poniższe — nie wymyślając faktów. + +### Struktura każdej strony +- **Jedno `h1`** (nagłówek hero/strony), potem `h2` sekcji, `h3` w środku — bez przeskoków + poziomów. `SectionHeader` dostaje `as="h1"` tylko w pierwszej sekcji. +- **Najpierw odpowiedź.** Pierwsze 1–2 zdania sekcji odpowiadają wprost na jej nagłówek + („Ile kosztuje…?” → „Od 1500 zł netto za…”). AI cytuje dokładnie takie zdania. +- **Nagłówki = pytania i frazy klientów**, nie hasła („Jak przebiega montaż?”, nie „Proces”). +- **Fakty zamiast ogólników:** liczby, zakres, obszar działania, czas realizacji, ceny „od” — + tylko z briefu; brak → `[DO UZUPEŁNIENIA]`. Zero „najlepsza jakość”, „profesjonalne podejście”. +- **Treść w HTML, nie w obrazach.** Kluczowa informacja nie może być tylko na grafice ani w + wideo. `alt` opisuje, co jest na obrazie (nie „zdjęcie1”, nie słowa kluczowe). +- **Każda strona linkuje dalej:** usługa → powiązane usługi + kontakt; wpis → usługa, której + dotyczy. Żadna strona bez linków wewnętrznych (CMSLink). +- **FAQ z prawdziwych pytań** z briefu → blok FAQ + `getPageJsonLd(…, { faq })` (FAQPage). + Pytania i odpowiedzi w JSON-LD = widoczne na stronie, słowo w słowo. +- **Długość:** strona usługi ≥ ~300 słów sensownej treści; krótsza = „cienka” — połącz z inną + albo poproś o materiał. + +### Wiarygodność (E-E-A-T) i encja firmy +- Strona **O nas** z ludźmi, doświadczeniem, certyfikatami (z briefu); wpisy z autorem i datą. +- **Te same dane firmy wszędzie** (nazwa, adres, telefon): stopka, kontakt, JSON-LD + (`LocalBusiness`/`Organization`), wizytówka Google. Jeden global Company jako źródło. +- **Site Settings → sameAs:** profile firmy (Google Business Profile, LinkedIn, Facebook…). +- **Site Settings → opis strony** (2–3 zdania: kto, co, gdzie) — zasila llms.txt, MCP i meta. +- **`aiSummary`** ważnych stron: popraw auto-fill, gdy streszczenie jest słabe (1–3 zdania, fakty). + +### Meta w zakładce SEO +Tytuł ≤ 60 znaków, unikalny, fraza na początku; opis ≤ 155 znaków, z konkretem i zachętą; +obraz udostępniania (1200×630) na stronach z ofertą — reszta dziedziczy domyślny z Site Settings. + +### noindex — kiedy TAK, kiedy NIE +| Strona | noindex? | +|---|---| +| „Dziękujemy” po formularzu, strona potwierdzenia | **tak** | +| wyniki wewnętrznej wyszukiwarki, strony filtrów/parametrów | **tak** (+ `disallowParams` w robots) | +| strona testowa, robocza, landing tylko dla kampanii płatnej | **tak** | +| staging, preview, kopia testowa całej strony | **`IPAL_NOINDEX=1` w env tego środowiska** — nie checkbox | +| strona główna, archiwa (blog, realizacje) | **nigdy** — panel zablokuje zapis | +| usługi, oferta, kontakt, o nas, wpisy | **nigdy** | +| polityka prywatności, cookies, regulamin | **nie** domyślnie (to sygnał wiarygodności, nie szkodzą); `noindex` tylko na prośbę klienta | +| 404 | nie dotyczy — plugin wyklucza ją z sitemapy i zwraca prawdziwe 404 | + +noindex **nie** zastępuje przekierowania ani usunięcia: stary adres → zmiana sluga (308 z +`trackSlugHistoryHook`), strona do skasowania → usuń ją. Treść roboczą trzymasz jako **draft** +(niepublikowana nie jest dostępna publicznie), nie jako opublikowaną stronę z noindex. + +Kontrole: `ipal-seo-check` (jedno h1, kolejność nagłówków, alt, obraz OG, cienkie strony, +linki wewnętrzne, noindex w sitemapie). --- @@ -315,7 +373,11 @@ Domyślnie: `pages`, `media` + globale pluginu (`site-settings`, `site-integrations`, Notifications, Cookie Settings) + globale projektu (nawigacja, stopka, firma). Nic więcej, dopóki klient jawnie nie wymaga. -**NIGDY:** `users` (wbudowane w Payload), druga `media`, `daneFirmy`/`settings`/ +**`users`** wstrzykuje `ipalKit` (kolekcja auth z `roles` i 2FA) — nie twórz jej, chyba +że potrzebujesz dodatkowych pól (wtedy własna `Users.ts` ze slugiem z `access.authCollection`; +plugin doda do niej role i 2FA). + +**NIGDY:** druga `media`, `daneFirmy`/`settings`/ `navigation`/`footer` jako kolekcje (to globale), FAQ/hero/features jako kolekcje (to bloki), kolekcja dla jednej rzeczy (to strona albo global). @@ -352,6 +414,23 @@ Trzy problemy, których nie wolno powtarzać: **zoo pól CTA** (`ctaLabel`, `cta2Text`, `buttonUrl`…), **pliki jako tekst** (`pdfUrl: '/files/x.pdf'`), **sekcja-monolit** (200–400 linii z kartami, ikonami SVG i stylami przycisków). +### 6.0 Dziesięć zasad komponentu (skrót — szczegóły niżej) +1. **Mały:** `Component.tsx` sekcji ≤ ~80 linii JSX; element listy > 5 linii → własny `XxxCard.tsx`. +2. **Jedna rzecz = jeden komponent, stylowany RAZ.** Przycisk to `Button` (wygląd) + `CMSLink` + (cel z panelu) — w sekcjach nigdy własne klasy przycisku. Zmiana wyglądu wszystkich + przycisków = jedna zmiana w `Button.tsx`. To samo: obraz → `Media`, nagłówek → `SectionHeader`. +3. **Powtarzalne = tablica „+ Add …”**, nigdy numerowane pola. Przyciski: `buildLinksField()` → + redaktor klika „Add Button” tyle razy, ile potrzebuje (`maxRows` = ile mieści projekt). + `cta1`/`cta2`/`cta3`, `feature1Title`…, `image2` = błąd audytu. +4. **Panel czytelny bez znajomości kodu:** etykiety EN 1–3 słowa, zwinięte wiersze z treścią + (`rowLabel`), ≤ 6 pozycji widocznych po dodaniu bloku, ustawienia techniczne w sidebarze. +5. **Wariant zamiast kopii:** inny wygląd tej samej sekcji = `variant` (select), nie drugi blok. +6. **Zero tekstu, linku i obrazu w JSX** — wszystko z panelu, w każdym języku. +7. **Puste pole = element się nie renderuje** (nie „Lorem”, nie pusty `
`). +8. **Serwer domyślnie;** interakcja w osobnym, małym pliku `'use client'` z prostymi propsami. +9. **Typy z `@/payload-types`**, eksport nazwany, import z `@/…`, bez barreli. +10. **Każdy nowy blok:** test pustego bloku w panelu (§6.5a) + `ipal-audit --quick`. + ### 6.1 Trzy warstwy ``` WARSTWA 1 — wspólne pola: linki z pluginu (buildLinkField, buildLinksField) @@ -613,6 +692,43 @@ bloku nie importował Reacta). Kod: [kod-sekcji.md](./skills/ipal-block/resource - Warianty → `Record`, nie łańcuchy ternary. Przykładowy `styles.css`: [kod-sekcji.md](./skills/ipal-block/resources/kod-sekcji.md). +### 6.11a Skalowanie (fluid / responsive) — od 360 px do 1920 px +- **Skala z pluginu:** `fluid.css` (rośnie do 1280 px) albo `fluid-wide.css` (rośnie do 1920 px — + wybierz, gdy projekt ma wyglądać inaczej na 13″ laptopie i 27″ monitorze). Zero `clamp()` w + komponentach; liczby z `DESIGN.md` → nadpisz `--ipal-*` w `:root`. +- **Wysokość ekranu:** zamiast `h-screen` / `100vh` → `min-h-[var(--ipal-hero-min-h)]` (svh, z + limitem). Nagłówek hero `--ipal-fs-display-fit`, odstępy hero `--ipal-space-section-fit` — na + 1366×768 CTA hero musi być widoczne bez przewijania. +- **Szerokości:** kontener `max-w-[var(--ipal-container)]` + `px-gutter`; tekst ciągły + `max-w-[var(--ipal-measure)]` (~68 znaków w linii). Żadnych stałych `w-[640px]`, `h-[500px]` + w sekcjach — `min()`, `%`, `aspect-*`, `max-w-*`. +- **Siatki:** `grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))]` albo breakpointy; + karta reaguje na swoją kolumnę: container queries (`@container` + `@md:`), nie tylko na ekran. +- **Obrazy kadrowane** (`object-cover`) mają punkt ostrości z panelu (`focalPoint: true` w + Media → `object-position` z `mediaImageProps`). +- **Ekrany testowe** (każda strona, przeglądarka / Playwright): 360×740, 390×844, 768×1024, + 1024×768, **1280×800, 1366×768, 1440×900** (laptopy 13–15″), 1536×864, 1920×1080, plus + zoom 125 % i 150 % na 1366 (częsty na Windows). Zero poziomego scrolla, tekst bez ucięć, + menu działa, CTA hero widoczne. + +### 6.11b Szybkość (Core Web Vitals) +| Co | Jak | Zakaz | +|---|---|---| +| obraz LCP (pierwszy widoczny, zwykle hero) | `` — dokładnie jeden na stronę | `priority` na wielu obrazach, hero jako CSS `background-image` | +| każdy inny obraz | `` — `sizes` = szerokość na ekranie | brak `sizes` (pobiera pełną szerokość), `` | +| placeholder | `buildMediaPlaceholderHook` + pole w Media (blur + kolor) | puste pudełka „wskakujące” przy ładowaniu | +| wideo w tle | `videoMode="background"`, MP4 H.264 ≤ 20 MB, bez dźwięku, z plakatem | wideo jako hero bez plakatu, `autoplay` z dźwiękiem | +| wideo z treścią | `videoMode="player"` (ładuje się po kliknięciu) | `preload="auto"` | +| YouTube | `` z `/client` (iframe dopiero po kliknięciu) | gołe `