SEO/GEO tools and project requests: site index, IndexNow, page JSON-LD, fixes
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]>
This commit is contained in:
@@ -10,6 +10,9 @@ import { buildHreflangAlternates } from './hreflang.js'
|
||||
* Subset of Next.js `Metadata` this helper produces. Kept local so the plugin
|
||||
* doesn't depend on `next` types; the shape is assignable to Next's Metadata.
|
||||
*/
|
||||
/** Share image with its size and alt — lets X/LinkedIn/Facebook render the card without guessing. */
|
||||
export type OgImage = { alt?: string; height?: number; url: string; width?: number }
|
||||
|
||||
export type PageMetadata = {
|
||||
alternates?: {
|
||||
canonical?: string
|
||||
@@ -20,8 +23,11 @@ export type PageMetadata = {
|
||||
description?: string
|
||||
openGraph?: {
|
||||
description?: string
|
||||
images?: { url: string }[]
|
||||
images?: OgImage[]
|
||||
locale?: string
|
||||
/** Article entries: ISO dates (og:article:published_time / modified_time). */
|
||||
modifiedTime?: string
|
||||
publishedTime?: string
|
||||
/** Site/brand name for the OG card. */
|
||||
siteName?: string
|
||||
title: string
|
||||
@@ -45,14 +51,28 @@ export type PageMetadata = {
|
||||
'max-video-preview'?: number
|
||||
}
|
||||
title: string
|
||||
/** X (Twitter) card — large image when there is one. */
|
||||
twitter?: {
|
||||
card: 'summary' | 'summary_large_image'
|
||||
description?: string
|
||||
images?: string[]
|
||||
title: string
|
||||
}
|
||||
}
|
||||
|
||||
type BuildMetadataArgs = {
|
||||
/**
|
||||
* Article dates for archive entries (blog posts…): og:type becomes 'article'
|
||||
* with published/modified times — a freshness signal for search and AI.
|
||||
*/
|
||||
article?: { modifiedTime?: null | string; publishedTime?: null | string }
|
||||
/** Absolute site origin, e.g. 'https://example.com'. */
|
||||
baseUrl?: string
|
||||
config: I18nConfig
|
||||
/** Home slug that collapses to the locale root. Defaults to 'home'. */
|
||||
homeSlug?: Record<string, string> | string
|
||||
/** Resolved OG image with size/alt (wins over imageUrl). */
|
||||
image?: null | OgImage
|
||||
/** Resolved OG image URL (page image or site defaultShareImage). */
|
||||
imageUrl?: null | string
|
||||
/** Current locale being rendered. */
|
||||
@@ -113,9 +133,11 @@ type BuildMetadataArgs = {
|
||||
* in — the plugin composes, it doesn't fetch.
|
||||
*/
|
||||
export function buildMetadata({
|
||||
article,
|
||||
baseUrl,
|
||||
config,
|
||||
homeSlug = 'home',
|
||||
image,
|
||||
imageUrl,
|
||||
locale,
|
||||
meta,
|
||||
@@ -152,7 +174,9 @@ export function buildMetadata({
|
||||
}
|
||||
}
|
||||
|
||||
const images = imageUrl ? [{ url: imageUrl }] : undefined
|
||||
const ogImage: null | OgImage = image?.url ? image : imageUrl ? { url: imageUrl } : null
|
||||
const images = ogImage ? [ogImage] : undefined
|
||||
const isArticle = Boolean(article?.publishedTime || article?.modifiedTime)
|
||||
|
||||
return {
|
||||
title,
|
||||
@@ -165,10 +189,18 @@ export function buildMetadata({
|
||||
title,
|
||||
...(description && { description }),
|
||||
...(images && { images }),
|
||||
type: 'website',
|
||||
type: isArticle ? 'article' : 'website',
|
||||
locale,
|
||||
...(siteName ? { siteName } : {}),
|
||||
...(canonical ? { url: canonical } : {}),
|
||||
...(article?.publishedTime ? { publishedTime: article.publishedTime } : {}),
|
||||
...(article?.modifiedTime ? { modifiedTime: article.modifiedTime } : {}),
|
||||
},
|
||||
twitter: {
|
||||
card: ogImage ? 'summary_large_image' : 'summary',
|
||||
title,
|
||||
...(description && { description }),
|
||||
...(ogImage ? { images: [ogImage.url] } : {}),
|
||||
},
|
||||
// robots: noindex pages are excluded (follow keeps link authority). Indexed
|
||||
// pages get generous snippet/preview limits so Google can show rich results
|
||||
|
||||
Reference in New Issue
Block a user