Page-filled form fields, links to entries, entry JSON-LD, R2-optional dev
Forms: `values` on RenderForm / BuilderForm / useBuilderForm fills fields the
page knows (chosen product variant, category) — read-only <output>, in the
SSR HTML, sent and validated like any field. prepareBuilderForm (/rsc) is the
server half of RenderForm for client components whose values change in the
browser; publicForm is exported so projects stop copying it.
Links: buildLinkField({ relationTo: ['pages', 'categories', …] }) — a
polymorphic relation; resolveLinkHref builds /{locale}/{archive}/{entry} from
`archives`, which getLinkOptions in createContentHelpers fills from Site
Settings.
SEO: pageJsonLd.entries — the main JSON-LD node per content collection
instead of BlogPosting; buildProductJsonLd emits an Offer only for a real
price from the panel.
Pages: createPageRoute / createNotFoundPage pass isFirst to blocks, so the
first section carries the page's only h1.
Fixes: ipalEnvRules({ storage: true }) requires R2_* in production only
(development: optional, all or none); buildImagesConfig allows the app's own
media on localhost outside production.
Docs, CHANGELOG, PROGRAMISTA §6 (34–37), ipal-form and ipal-upgrade skills.
Tests: builderForm, links, drafts (entries + archives), seo, media, env.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
46d30d4ecd
commit
f809526f1d
@@ -239,6 +239,10 @@ describe('one-call helpers — layout, page, GEO routes', () => {
|
||||
const route = createPageRoute(h(), { blocks: {}, notFound, permanentRedirect })
|
||||
const el = (await route.Page({ params: Promise.resolve({ slug: ['uslugi'] }) })) as { props: { children: unknown[] } }
|
||||
expect(JSON.stringify(el.props.children[0])).toContain('Usługi')
|
||||
// Blocks get the locale and whether they are the first section (the page's h1).
|
||||
const blocksEl = el.props.children[1] as { props: { enhanceProps: (a: { allBlocks: never[]; block: never; index: number }) => Record<string, unknown> } }
|
||||
expect(blocksEl.props.enhanceProps({ allBlocks: [], block: {} as never, index: 0 })).toMatchObject({ isFirst: true, locale: 'pl' })
|
||||
expect(blocksEl.props.enhanceProps({ allBlocks: [], block: {} as never, index: 1 }).isFirst).toBe(false)
|
||||
await expect(route.Page({ params: Promise.resolve({ slug: ['nie-ma'] }) })).rejects.toThrow('NEXT_NOT_FOUND')
|
||||
expect((await route.generateMetadata({ params: Promise.resolve({ slug: ['uslugi'] }) })).alternates?.canonical).toBe('https://acme.pl/uslugi')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user