Block library: item headings follow the section; the leading block's first image is the LCP image
Found by ipal-doctor live-seo on the reference archive pages (entry list under a
page header without a picture): cards jumped h1 → h3, and the first card image
was lazy.
- itemHeadingLevel: items one below the section heading (h3 under h2, h2 under the
page h1, h2 when the block shows no heading); createBlockRegistry({ itemHeadings })
fixes a level per block. featureGrid, entryList, pricing, steps, team.
- blockPosition / blockHasImage (root): createPageRoute and the 404 view pass
firstImage next to isFirst; leadsWithImage marks the first image of the leading
block eager + fetchPriority high (hero, textMedia, featureGrid, gallery, team,
entryList); priorityImage: false turns it off.
- reference/ipal-doctor.json: the two live-seo silences removed; reference skills
and docs/agent/reference-site/INDEX.md refreshed.
- bin/ipal-blocks.mjs executable like the other bins.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
dd11bc8146
commit
6f56ef4205
@@ -80,6 +80,11 @@ fifteen ready page sections and ten page templates. A new site in one command: `
|
||||
Type `CookieButtonProps`.
|
||||
|
||||
### Fixed
|
||||
- **Block library — headings and the LCP image** (found by `ipal-doctor` live-seo on the archive pages): item headings
|
||||
follow the section — `h3` under a section heading, `h2` when the block shows none (an entry list under the page header
|
||||
no longer jumps `h1` → `h3`); override with `createBlockRegistry({ itemHeadings: { entryList: 'h3' } })`. The first
|
||||
image of the block that leads the page loads eagerly with high priority — `createPageRoute` now passes `firstImage`
|
||||
("no block before this one shows an image", `blockPosition`) next to `isFirst`; `priorityImage: false` turns it off.
|
||||
- **Sitemap, llms.txt, the site index (MCP `list_pages`), search (`searchContent`, the search route, MCP
|
||||
`search_content`):** the page assigned as the 404 page is no longer listed —
|
||||
it answers 404 at its own address (`unlistedPageIds(settings)`). A 404 page that is also the homepage stays.
|
||||
|
||||
@@ -81,16 +81,6 @@ legacy-peer-deps=true
|
||||
"until": "2026-11-30",
|
||||
"reason": "Follow-up for the reference-site track: three pages per language have no own meta description and fall back to the site description; the seed should give each page one"
|
||||
},
|
||||
"live-seo:heading-levels-skipped": {
|
||||
"off": true,
|
||||
"until": "2026-11-30",
|
||||
"reason": "Follow-up for the block-library track: entryList cards use h3 with no h2 on the archive pages (h1 → h3)"
|
||||
},
|
||||
"live-seo:first-image-not-prioritised-lcp": {
|
||||
"off": true,
|
||||
"until": "2026-11-30",
|
||||
"reason": "Follow-up for the block-library track: on the archive pages the first image is an entryList card, which is not marked priority"
|
||||
},
|
||||
"live-seo:thin-pages-words": {
|
||||
"off": true,
|
||||
"until": "2026-11-30",
|
||||
|
||||
@@ -104,6 +104,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `RenderBlocks` | `@intecion/ipal-kit/rsc` | Server block renderer: `{ blocks, components, enhanceProps? }` — each block through a `blockType → component` map, skips unknown ones, no extra markup. Do not write your own loop over blocks. Nested blocks render their own `RenderBlocks` (do not pass the map as a prop). |
|
||||
| `blockPosition({ allBlocks, index })`, `blockHasImage(data)` | `@intecion/ipal-kit` | `{ isFirst, firstImage }` for a block — first section (page `h1`) and "no earlier block shows an image" (LCP image); createPageRoute passes both, spread it in your own `enhanceProps`. |
|
||||
| `buildSectionHeaderField(opts?)` | `@intecion/ipal-kit` | `header` field group (eyebrow, heading, intro — localized) for every section block; `interfaceName` `SectionHeaderData`. Options: `name`, `fields`, `interfaceName`. |
|
||||
| `buildSectionSettingsField(opts?)` | `@intecion/ipal-kit` | `settings` group in the block sidebar: `anchor` (#id) + `background` (select, default Default/Muted/Inverted) + your own fields; instead of a per-block `bgColor`/`sectionId`. |
|
||||
|
||||
@@ -125,18 +126,19 @@ Fifteen ready blocks and ten page templates. **Use a library block (or a variant
|
||||
| `blockThumbnail(slug)` | `@intecion/ipal-kit/blocks` | Inline SVG sketch (data URL) for the block picker — what `thumbnail: true` uses. |
|
||||
| `faqItemsFromLayout(doc, { field?, slugs? })` | `@intecion/ipal-kit/blocks` | FAQ questions of the page's FAQ blocks → `getPageJsonLd(locale, slug, { faq: faqItemsFromLayout })` (FAQPage). |
|
||||
| `blockLibraryManifest`, `buildBlockLibraryManifest()`, `fieldPaths(fields)` | `@intecion/ipal-kit/blocks` | Plain data: every block's slug, interface name, variants, stored field paths; primitives, field builders, templates — for `ipal-doctor` and tests. |
|
||||
| `createBlockRegistry(content, options?)` | `@intecion/ipal-kit/blocks/rsc` | `blockType → component` map for `createPageRoute` / `RenderBlocks`, bound to lib/content. Options: `Image`, `Link` (next/image, next/link), `sendForm`, `formClassNames`, `contactDetails`, `classNames` (per block part), `ui` (swap primitives), `components` (swap a block), `backgrounds`, `slugs`, `only`, `extra` (own blocks), `noSnippet` (e.g. `['cta']`), `icons`, `texts`, `lightbox`, `richText`, `entryCard`, `mapTestimonial`. |
|
||||
| `createBlockRegistry(content, options?)` | `@intecion/ipal-kit/blocks/rsc` | `blockType → component` map for `createPageRoute` / `RenderBlocks`, bound to lib/content. Options: `Image`, `Link` (next/image, next/link), `sendForm`, `formClassNames`, `contactDetails`, `classNames` (per block part), `ui` (swap primitives), `components` (swap a block), `backgrounds`, `slugs`, `only`, `extra` (own blocks), `noSnippet` (e.g. `['cta']`), `itemHeadings`, `priorityImage`, `icons`, `texts`, `lightbox`, `richText`, `entryCard`, `mapTestimonial`. |
|
||||
| `LIBRARY_BLOCK_COMPONENTS` | `@intecion/ipal-kit/blocks/rsc` | The plugin's component per slug. |
|
||||
| `HeroBlock`, `TextMediaBlock`, `FeatureGridBlock`, `GalleryBlock`, `FaqBlock`, `CtaBlock`, `ContactBlock`, `TeamBlock`, `PricingBlock`, `LogosBlock`, `TestimonialsBlock`, `StatsBlock`, `RichTextBlock`, `StepsBlock`, `EntryListBlock` | `@intecion/ipal-kit/blocks/rsc` | The block components (server; props `LibraryBlockProps`: data + `locale`, `isFirst`, `ui`, `ctx`, `classNames`). |
|
||||
| `HERO_PARTS`, `TEXT_MEDIA_PARTS`, `FEATURE_GRID_PARTS`, `GALLERY_PARTS`, `FAQ_PARTS`, `CTA_PARTS`, `CONTACT_PARTS`, `TEAM_PARTS`, `PRICING_PARTS`, `LOGOS_PARTS`, `TESTIMONIALS_PARTS`, `STATS_PARTS`, `RICH_TEXT_PARTS`, `STEPS_PARTS`, `ENTRY_LIST_PARTS` | `@intecion/ipal-kit/blocks/rsc` | Default token classes per block part — the keys of `classNames`. |
|
||||
| `defaultEntryCard(doc)`, `defaultTestimonial(doc)` | `@intecion/ipal-kit/blocks/rsc` | Default mapping of a collection document to an entry card / a testimonial (`entryCard`, `mapTestimonial` replace them). |
|
||||
| `Section`, `SECTION_BACKGROUNDS`, `SectionHeader`, `Media`, `CMSLink`, `Anchor`, `buttonClass`, `BUTTON_CLASSES`, `Container`, `CONTAINER_WIDTHS`, `Card`, `CARD_CLASS`, `CARD_INTERACTIVE_CLASS` | `@intecion/ipal-kit/blocks/rsc` | UI primitives, token utilities only: section (anchor, background, `data-surface`), heading group, image/video, panel link, link element, button looks, page column, card. |
|
||||
| `itemHeadingLevel(slug, props)`, `leadsWithImage(props)` | `@intecion/ipal-kit/blocks/rsc` | Item heading tag (one below the section heading; `h2` without one; `itemHeadings` overrides) and whether the block's first image is the page's LCP image (`isFirst` / `firstImage`; `priorityImage: false` turns it off). |
|
||||
| `Buttons`, `headingId(block)`, `TitleLink`, `GRID_COLUMNS`, `cx`, `parts(defaults, overrides)` | `@intecion/ipal-kit/blocks/rsc` | Helpers for own blocks: button row, heading id for `aria-labelledby`, card title link (plain text when the link is dead), grid columns, class joining, part classes. |
|
||||
| `BLOCK_TEXTS`, `blockTexts(locale, own?)`, `fillText(text, value)` | `@intecion/ipal-kit/blocks/rsc` | Visitor texts the blocks write (rating, step) in en/pl; override with `texts`. |
|
||||
| `pageTemplates` | `@intecion/ipal-kit/templates` | `home`, `about`, `services`, `service`, `contact`, `blogIndex`, `post`, `legal(role)`, `cookiePolicy`, `notFound` → `{ title, slug, layout }` for `seed.upsertBySlug('pages', …)`. Options: `blocks`, `overrides`, `layout`, `slug`, `title`, `defaultLocale`, `linkTo`; `contact`/`service` take `form` (`{ $form: 'title' }`). After launch: only with `SEED_ONLY`. |
|
||||
| `systemPageRefs(roles)` | `@intecion/ipal-kit/templates` | `{ homepage: 'start' }` → `{ homepage: { $page: 'start' } }` for `seed.fillGlobal('site-settings', …)`. |
|
||||
|
||||
**Types:** `BlockOptions`, `BlockBuilder`, `BlockLocalization`, `LibraryBlockSetting`, `LibraryBlocksShared`, `LibraryBlockSlug`, `LibraryBlocksOptions`, `VariantOption`, `LibraryBlockDefinition`, `ContactOptions`, `EntryListOptions`, `FeatureGridOptions`, `TestimonialsOptions`, `ItemsFieldOptions`, `MediaFieldOptions`, `VariantFieldOptions`, `IconFieldOptions`, `Columns`, `BlockLibraryManifest`, `ManifestBlock`, `ManifestField` (`/blocks`); `BlockRegistryOptions`, `BlockContent`, `BlockContext`, `BlockUi`, `LibraryBlockProps`, `ContactDetail`, `EntryCard`, `TestimonialItem`, `BlockTexts`, `PartClasses`, `BaseBlockData`, `LinkData`, `LinksData`, `MediaValue`, `RichTextData`, `SectionHeaderData`, `SectionSettingsData`, `HeroBlockData`, `TextMediaBlockData`, `FeatureGridBlockData`, `FeatureItem`, `GalleryBlockData`, `GalleryItem`, `FaqBlockData`, `FaqItem`, `CtaBlockData`, `ContactBlockData`, `TeamBlockData`, `TeamMember`, `PricingBlockData`, `PricingPlan`, `LogosBlockData`, `LogoItem`, `TestimonialsBlockData`, `StatsBlockData`, `StatItem`, `RichTextBlockData`, `StepsBlockData`, `StepItem`, `EntryListBlockData`, `CMSLinkProps`, `ResolveLink`, `LinkComponent`, `ImageComponent`, `MediaProps`, `SectionProps`, `SectionHeaderProps`, `HeadingLevel`, `CardProps`, `ContainerProps`, `ContainerWidth` (`/blocks/rsc`); `TemplateOptions`, `TemplatePage`, `TemplateBlock`, `TemplateValue` (`/templates`).
|
||||
**Types:** `BlockOptions`, `BlockBuilder`, `BlockLocalization`, `LibraryBlockSetting`, `LibraryBlocksShared`, `LibraryBlockSlug`, `LibraryBlocksOptions`, `VariantOption`, `LibraryBlockDefinition`, `ContactOptions`, `EntryListOptions`, `FeatureGridOptions`, `TestimonialsOptions`, `ItemsFieldOptions`, `MediaFieldOptions`, `VariantFieldOptions`, `IconFieldOptions`, `Columns`, `BlockLibraryManifest`, `ManifestBlock`, `ManifestField` (`/blocks`); `BlockRegistryOptions`, `BlockContent`, `BlockContext`, `BlockUi`, `LibraryBlockProps`, `ContactDetail`, `EntryCard`, `TestimonialItem`, `BlockTexts`, `PartClasses`, `BaseBlockData`, `LinkData`, `LinksData`, `MediaValue`, `RichTextData`, `SectionHeaderData`, `SectionSettingsData`, `HeroBlockData`, `TextMediaBlockData`, `FeatureGridBlockData`, `FeatureItem`, `GalleryBlockData`, `GalleryItem`, `FaqBlockData`, `FaqItem`, `CtaBlockData`, `ContactBlockData`, `TeamBlockData`, `TeamMember`, `PricingBlockData`, `PricingPlan`, `LogosBlockData`, `LogoItem`, `TestimonialsBlockData`, `StatsBlockData`, `StatItem`, `RichTextBlockData`, `StepsBlockData`, `StepItem`, `EntryListBlockData`, `CMSLinkProps`, `ResolveLink`, `LinkComponent`, `ImageComponent`, `ItemHeadingLevel`, `MediaProps`, `SectionProps`, `SectionHeaderProps`, `HeadingLevel`, `CardProps`, `ContainerProps`, `ContainerWidth` (`/blocks/rsc`); `TemplateOptions`, `TemplatePage`, `TemplateBlock`, `TemplateValue` (`/templates`).
|
||||
|
||||
## Cookie consent (`consent`) — details: `node_modules/@intecion/ipal-kit/docs/consent.md`
|
||||
|
||||
|
||||
+10
-3
@@ -108,8 +108,12 @@ block has them) → `variant` (sidebar) → `settings` (sidebar: anchor, backgro
|
||||
| `entryList` (`buildEntryListBlock`) | Entry list | `entryCollection`, `mode` (latest / chosen), `limit`, `entries` | `cards`, `list` | each title links to its entry and covers the card; dates in `<time>` |
|
||||
|
||||
**Rules every block meets:** one `<section>` with `aria-labelledby` its heading and `data-ipal-block`; `h1` only in the
|
||||
first block (`isFirst` from `createPageRoute`), `h2` otherwise, items `h3`; images through `Media` (alt from the media
|
||||
document, width and height, lazy except the hero); visible focus (`outline-focus`); no autoplay, motion only through
|
||||
first block (`isFirst` from `createPageRoute`), `h2` otherwise; **item headings one level below the section heading**
|
||||
(`itemHeadingLevel`: `h3` under a section `h2`, `h2` under the page `h1`, and `h2` when the block shows no heading of its
|
||||
own — a list right under the page header never jumps from `h1` to `h3`); images through `Media` (alt from the media
|
||||
document, width and height, lazy) — **except the page's LCP image**: the first image of the block that leads the page
|
||||
(`leadsWithImage`: the first section, or `firstImage` from `createPageRoute` — no block before it shows an image, e.g. an
|
||||
entry list under a page header without a picture) loads eagerly with `fetchPriority="high"`, one per block; visible focus (`outline-focus`); no autoplay, motion only through
|
||||
the token durations (0 ms under reduced motion); **an empty block renders nothing** (no empty section, no "Lorem").
|
||||
|
||||
**Visitor texts** the components write themselves — `rating` ("Rated {value} out of 5") and `step` ("Step {value}") —
|
||||
@@ -166,6 +170,8 @@ plugin's components. `content` needs `resolveLink`; `getEntries` (entry list), `
|
||||
| `sendForm`, `formClassNames`, `contactDetails` | the contact block: form action, form classes, details beside the form |
|
||||
| `entryCard`, `mapTestimonial` | how a collection document becomes an entry card / a testimonial (defaults `defaultEntryCard`, `defaultTestimonial`) |
|
||||
| `noSnippet` | blocks kept out of Google's snippets (`<NoSnippet>`), e.g. `['cta']` when the same call to action is on every page (docs/seo.md) |
|
||||
| `itemHeadings` | item heading level per block, e.g. `{ entryList: 'h3' }` (`h2` / `h3` / `h4`) — default: one below the section heading |
|
||||
| `priorityImage` | `false` = never mark a block's first image as the LCP image (default on) |
|
||||
| `icons`, `texts`, `lightbox`, `richText` | feature icons by name; visitor texts; `lightbox: false` = plain gallery images; `richText.className` for every rich text |
|
||||
|
||||
**UI primitives** (`/blocks/rsc`), each styled once with token utilities: `Section` (anchor, background,
|
||||
@@ -176,7 +182,8 @@ keeps its content without a link, so an empty link group never hides it),
|
||||
`buttonClass` / `BUTTON_CLASSES` (button looks by appearance), `Container` / `CONTAINER_WIDTHS`, `Card` / `CARD_CLASS` /
|
||||
`CARD_INTERACTIVE_CLASS`. Helpers for the project's own blocks: `Buttons` (a block's button row), `headingId(block)`
|
||||
(the heading id for `aria-labelledby`), `TitleLink` (a card title that links when its link resolves), `GRID_COLUMNS`,
|
||||
`cx`, `parts(defaults, overrides)`.
|
||||
`cx`, `parts(defaults, overrides)`, `itemHeadingLevel(slug, props)` (the item heading tag) and `leadsWithImage(props)`
|
||||
(whether the block's first image is the LCP image).
|
||||
|
||||
**Every component is exported** (`HeroBlock`, `TextMediaBlock`, `FeatureGridBlock`, `GalleryBlock`, `FaqBlock`, `CtaBlock`,
|
||||
`ContactBlock`, `TeamBlock`, `PricingBlock`, `LogosBlock`, `TestimonialsBlock`, `StatsBlock`, `RichTextBlock`,
|
||||
|
||||
+2
-1
@@ -103,7 +103,8 @@ interfaceName })`. The project maps the background values to its `<Section>` cla
|
||||
## Block component
|
||||
|
||||
Each component gets the block data as props (plus whatever `enhanceProps` returns;
|
||||
in `createPageRoute` also `locale`, `isFirst` and `blockProps` — frontend.md). Spacing/layout are yours — the engine does not wrap
|
||||
in `createPageRoute` also `locale`, `isFirst`, `firstImage` and `blockProps` — frontend.md; `blockPosition` computes the
|
||||
two for your own `enhanceProps`). Spacing/layout are yours — the engine does not wrap
|
||||
blocks in any markup.
|
||||
|
||||
```tsx
|
||||
|
||||
+4
-1
@@ -111,7 +111,10 @@ export const generateStaticParams = route.generateStaticParams
|
||||
|
||||
Order in `Page`: under-construction mode (when `redirect` is passed) → `resolveRoute(locale, segments, 1)` →
|
||||
no route: `resolvePageRedirect` (308) or `onMissing` → home page slug at its own address: 308 to root
|
||||
(`homeAlias`) → `RenderBlocks` with `{ locale, isFirst, …blockProps }` → `render` (optional) → `<JsonLdGraph>`.
|
||||
(`homeAlias`) → `RenderBlocks` with `{ locale, isFirst, firstImage, …blockProps }` → `render` (optional) → `<JsonLdGraph>`.
|
||||
`isFirst` / `firstImage` come from `blockPosition({ allBlocks, index })` (root): the first section (its heading is the
|
||||
page's `h1`) and "no block before this one shows an image" (its first image is the LCP image; `blockHasImage(data)`
|
||||
checks a block's data). Your own `enhanceProps` can spread `blockPosition(args)` the same way.
|
||||
|
||||
| Option | Default | What it does |
|
||||
|---|---|---|
|
||||
|
||||
Reference in New Issue
Block a user