Block library: fixes from the first visual test on the reference site

- CMSLink: a link that wraps content (a logo, a card) and leads nowhere keeps the
  content — an empty link group ({ type: 'internal' }) no longer hides logos
- entryList: field `collection` → `entryCollection` (Mongoose reserves
  `collection`; unreleased, snapshot updated) + a test against reserved names
- post template starts with a page hero holding the title (the page's h1)
- legal and cookie policy templates set noindex: true (AGENT.md §0c)
- hero background: a full bg-overlay scrim under the text
- MediaValue accepts any object (generated Media types fit without a cast)
- contact: Turnstile renders dark in an inverted section

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 15:03:39 +01:00
co-authored by Claude Opus 5.5
parent 51f80cea13
commit 29ede3ad4b
12 changed files with 85 additions and 30 deletions
@@ -36,7 +36,15 @@ export async function ContactBlock(props: LibraryBlockProps<ContactBlockData>) {
])
const formEl = (
<div className={c.form}>
<RenderForm action={ctx.sendForm} classNames={ctx.formClassNames} form={form as never} linkOptions={linkOptions} locale={locale} texts={texts as BuilderFormTexts} />
<RenderForm
action={ctx.sendForm}
classNames={ctx.formClassNames}
form={form as never}
linkOptions={linkOptions}
locale={locale}
texts={texts as BuilderFormTexts}
turnstileTheme={settings?.background === 'inverted' ? 'dark' : 'page'}
/>
</div>
)
const aside = withDetails && (content || details.length) ? (
@@ -7,8 +7,8 @@ import { cx, parts } from '../../ui/cx.js'
import { TitleLink } from '../../ui/TitleLink.js'
export type EntryListBlockData = {
collection?: null | string
entries?: { relationTo: string; value: unknown }[] | null
entryCollection?: null | string
limit?: null | number
mode?: null | string
} & BaseBlockData
@@ -36,7 +36,7 @@ type Row = { card: EntryCard; collection: string; doc: Record<string, unknown> }
/** The latest entries of a collection, or entries chosen by hand; each card links to its entry. */
export async function EntryListBlock(props: LibraryBlockProps<EntryListBlockData>) {
const { classNames, collection, ctx, entries, header, isFirst, limit, links, locale, mode, settings, ui, variant } = props
const { classNames, ctx, entries, entryCollection: collection, header, isFirst, limit, links, locale, mode, settings, ui, variant } = props
const toCard = ctx.entryCard ?? defaultEntryCard
let docs: { collection: string; doc: Record<string, unknown> }[] = []
if (mode === 'selected') {
@@ -19,7 +19,8 @@ export const buildEntryListBlock = defineLibraryBlock<EntryListOptions>({
const latest = (_: unknown, s: { mode?: string } | undefined) => s?.mode !== 'selected'
return [
{
name: 'collection',
// Not `collection`: Mongoose reserves that path name.
name: 'entryCollection',
type: 'select',
defaultValue: collections[0]?.value,
label: adminText('Show', 'Pokaż'),
@@ -10,7 +10,7 @@ export type HeroBlockData = { media?: MediaValue; poster?: MediaValue } & BaseBl
export const HERO_PARTS = {
background: 'relative isolate flex min-h-[var(--ipal-hero-min-h)] items-center overflow-hidden',
backgroundMedia: 'absolute inset-0 -z-10 h-full w-full object-cover',
backgroundOverlay: 'absolute inset-0 -z-10 bg-linear-to-t from-overlay to-transparent',
backgroundOverlay: 'absolute inset-0 -z-10 bg-overlay',
centered: 'mx-auto max-w-narrow text-center',
media: 'h-auto w-full rounded-media object-cover',
page: 'max-w-measure',