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
@@ -288,3 +288,16 @@ describe('createPageMetadata — siteDescription fallback', () => {
|
||||
expect(metadata.description).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
describe('buildProductJsonLd', () => {
|
||||
test('an Offer only for a real price; "from" is a minimum, not a price', async () => {
|
||||
const { buildProductJsonLd } = await import('../src/modules/seo/buildProductJsonLd.js')
|
||||
const base = { name: 'Pierścionek', url: 'https://acme.pl/pl/wyroby/p' }
|
||||
expect(buildProductJsonLd(base)).not.toHaveProperty('offers')
|
||||
expect(buildProductJsonLd({ ...base, price: { amount: 6900, currency: 'PLN', kind: 'exact' } }).offers).toMatchObject({ price: 6900, priceCurrency: 'PLN' })
|
||||
expect(buildProductJsonLd({ ...base, availability: 'MadeToOrder', price: { amount: 6900, currency: 'PLN', kind: 'from' } }).offers).toMatchObject({
|
||||
availability: 'https://schema.org/MadeToOrder',
|
||||
priceSpecification: { minPrice: 6900 },
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user