GEO / SEO
- collectSiteIndex: one list of public docs per locale (pages + archive
entries) on sitemap rules; llms.txt/llms-full and MCP list_pages now include
blog/content entries and every language. Fixes hard-coded "## Strony" heading
and homepage not collapsing to the locale root in llms.txt.
- Markdown frontmatter: canonical url + updated date.
- Metadata: X/Twitter card, OG image width/height/alt, og:type article with
published/modified times for entries.
- Fix: Site Settings "defaultShareImage" was never used — now the OG fallback.
- getPageJsonLd (createContentHelpers): WebPage/CollectionPage/BlogPosting,
BreadcrumbList from the real route, FAQPage via a project mapper.
- IndexNow (opt-in ipalKit({ indexNow: true })): submit published URLs in all
languages, key generated in Site Integrations or INDEXNOW_KEY, key route.
- sameAs profiles in Site Settings + sameAsUrls(); sitemap <image:image>.
From project reports
- Fix: package exports were missing ./env and ./fluid.css although the docs
import them (TS2307); regression test checks every documented subpath.
- Fix: plugins run before Payload adds its default users collection, so roles
and 2FA had nothing to attach to — ipalKit injects an auth collection when
the project has none (project's own one wins). Audit no longer errors on it.
- createMarkdownRoute, createSubmitAction (/server, headers injected).
- formatOpeningHours (PL/EN/DE text → schema.org), used by
buildLocalBusinessJsonLd, which also takes a schema.org `type`.
- buildNavigationJsonLd straight from the header global.
- buildCsp googleMaps: full Maps JS API domain set; values de-duplicated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
57 lines
2.1 KiB
TypeScript
57 lines
2.1 KiB
TypeScript
type MediaLike = { url?: null | string } | null | undefined
|
|
|
|
type OrganizationJsonLdArgs = {
|
|
/** Logo media (from panel). Google uses this for brand knowledge panels. */
|
|
logo?: MediaLike
|
|
/** Organization / site name. */
|
|
name: string
|
|
/** Optional social / official profile URLs (sameAs). */
|
|
sameAs?: string[]
|
|
/** Absolute site URL (https://…). */
|
|
url: string
|
|
}
|
|
|
|
/**
|
|
* Builds Organization JSON-LD (schema.org) — helps Google associate the site
|
|
* with a brand: name, logo, official links. Improves how the site appears in
|
|
* search (brand recognition, logo in knowledge panels) and is a signal used
|
|
* alongside favicon for identity.
|
|
*
|
|
* Returns a plain object; the project renders it with <JsonLdGraph> in the
|
|
* root layout:
|
|
*
|
|
* import { buildOrganizationJsonLd } from '@intecion/ipal-kit'
|
|
* const jsonLd = buildOrganizationJsonLd({
|
|
* name: settings.siteName, url: baseUrl, logo: settings.logo,
|
|
* })
|
|
* // render through JsonLdGraph (@intecion/ipal-kit/rsc) — it escapes '<' and wraps @graph:
|
|
* <JsonLdGraph schemas={[jsonLd]} />
|
|
*
|
|
* Data comes from the panel (siteName, logo) — nothing hardcoded. Emit once in
|
|
* the root layout (Organization is site-wide, not per page).
|
|
*/
|
|
export function buildOrganizationJsonLd({ name, logo, sameAs, url }: OrganizationJsonLdArgs) {
|
|
const logoUrl = logo?.url
|
|
|
|
return {
|
|
name,
|
|
'@context': 'https://schema.org',
|
|
'@type': 'Organization',
|
|
url,
|
|
...(logoUrl ? { logo: logoUrl.startsWith('http') ? logoUrl : `${url}${logoUrl}` } : {}),
|
|
...(sameAs && sameAs.length > 0 ? { sameAs } : {}),
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Profile URLs from Site Settings → sameAs (array of { url }), ready for
|
|
* buildOrganizationJsonLd / buildLocalBusinessJsonLd. Empty when none.
|
|
*/
|
|
export function sameAsUrls(settings: null | Record<string, unknown> | undefined): string[] {
|
|
const rows = settings?.sameAs
|
|
if (!Array.isArray(rows)) {return []}
|
|
return rows
|
|
.map((r) => (r && typeof r === 'object' ? (r as { url?: unknown }).url : undefined))
|
|
.filter((u): u is string => typeof u === 'string' && /^https?:\/\//.test(u))
|
|
}
|