Files
ipal-kit/reference/src/lib/content.ts
T
Radosław SmolińskiandClaude Opus 5.5 804a09efed Project starter: ipal-kit create <domain> generates a new site from the reference site
- bin `ipal-kit` (subcommand `create`): the architecture questions (or --answers JSON),
  rendering from reference/ through starter.manifest.json (placeholders, @starter:if variants,
  //: alternatives, demo dropped), answers into AGENTS.md "Project decisions" and ipal-doctor.json,
  local .env with a fresh PAYLOAD_SECRET, install from the shipped lockfile, ipal-skills,
  ipal-tokens, generate:types/importmap, typecheck, ipal-doctor when shipped, secret check,
  first commit
- @intecion/ipal-kit/starter: the building blocks (renderSite, validateAnswers, applyVariants,
  collectBundle, lockfileWithoutPlugin, secretFindings …)
- build:starter packs reference/ into dist/starter/template.json.gz (90 KB);
  starter:gate in prepublishOnly: site from the packed tarball, frozen install, seed, build,
  targeted SEED_ONLY seed in production mode, full seed refused, pnpm start checks
- D15: plugin dependencies pinned exactly (nodemailer 10.3.1)
- reference/: @starter:if markers (runs as before), manifest generate/variants/rewrite
- docs: project-starter.md, AGENT.md, ipal-setup, ipal-site, ipal-reference (+ api.md),
  README, PROGRAMISTA §2, CHANGELOG, docs/README, reference index

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:50:44 +01:00

85 lines
2.8 KiB
TypeScript

import { faqItemsFromLayout } from '@intecion/ipal-kit/blocks'
// @starter:if localBusiness
import { buildLocalBusinessJsonLd, createContentHelpers } from '@intecion/ipal-kit'
import { getPayload } from 'payload'
import { contentConfig } from '@/content.config'
import { i18nConfig, type Locale } from '@/i18n.config'
// @starter:else
//: import { createContentHelpers } from '@intecion/ipal-kit'
//:
//: import { contentConfig } from '@/content.config'
//: import { i18nConfig } from '@/i18n.config'
// @starter:endif
import config from '@/payload.config'
/** The ONLY access to Payload, routes, links and navigation (AGENT.md §3, PROGRAMISTA §2.7). */
export const {
// data
getCachedPayload,
getSettings,
getConfiguredLocales,
getConstructionMode,
resolveRoute,
getEntries,
getNotFoundPage,
generatePageMetadata,
generateStaticParams,
getPageJsonLd,
resolvePageRedirect,
i18n,
// layout, forms, links
getSiteShell,
getFormTexts,
getLinkOptions,
getHomeSlug,
resolveLink,
resolveNav,
getSystemLinks,
// routes (re-exported in app/)
sitemap,
sitemapRoute,
getRobots,
manifest,
llmsRoute,
llmsFullRoute,
markdownRoute,
mcpGET,
mcpPOST,
healthRoute,
indexNowKeyRoute,
} = createContentHelpers({
baseUrl: process.env.NEXT_PUBLIC_SERVER_URL,
config,
content: contentConfig,
i18n: i18nConfig,
markdownAlternate: true, // GEO: <link rel="alternate" type="text/markdown"> on every page
mcp: { serverName: 'example-studio-site' },
pageJsonLd: { faq: (doc) => faqItemsFromLayout(doc) }, // FAQ blocks → FAQPage rich results
// @starter:if aiBotsBlockTraining
//: robots: { aiBots: 'block-training' }, // client decision — AGENTS.md → Project decisions (ipal-audit-skip: aibots)
// @starter:endif
// @starter:if aiBotsDisallow
//: robots: { aiBots: 'disallow' }, // client decision — AGENTS.md → Project decisions (ipal-audit-skip: aibots)
// @starter:endif
// @starter:if localBusiness
// LocalBusiness from the Company global (replaces the default WebSite + Organization from Site settings)
siteJsonLd: async ({ baseUrl, locale }) => {
const payload = await getPayload({ config })
const company = await payload.findGlobal({ slug: 'company', locale: locale as Locale })
return [
buildLocalBusinessJsonLd({
address: { city: company.address?.city ?? undefined, country: company.address?.country ?? 'PL', postalCode: company.address?.postalCode ?? undefined, street: company.address?.street ?? undefined },
name: company.name,
openingHours: company.hours ?? undefined,
sameAs: (company.socials ?? []).map((s) => s.url),
telephone: company.phone ?? undefined,
type: 'ProfessionalService',
url: baseUrl,
}),
]
},
// @starter:endif
summaryField: 'aiSummary',
})