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:
@@ -4,9 +4,10 @@ import type { ContentOption } from '../content/index.js'
|
||||
import type { I18nConfig } from '../i18n/index.js'
|
||||
import type { ClientIpOptions } from '../shared/rateLimit.js'
|
||||
|
||||
import { createMarkdownRenderer, listContent, searchContent } from '../content/index.js'
|
||||
import { createMarkdownRenderer, searchContent } from '../content/index.js'
|
||||
import { getDefaultLocale, isValidLocale } from '../i18n/index.js'
|
||||
import { readSiteMetaConfig } from '../seo/readSiteMetaConfig.js'
|
||||
import { collectSiteIndex } from '../seo/siteIndex.js'
|
||||
import { clientIp, consumeRateLimit, tooManyRequests } from '../shared/rateLimit.js'
|
||||
|
||||
/**
|
||||
@@ -103,7 +104,7 @@ export function createMcpRoute(args: CreateMcpRouteArgs) {
|
||||
const rl = args.rateLimit === false ? null : { max: 60, windowMs: 60_000, ...args.rateLimit }
|
||||
|
||||
const origin = baseUrl?.replace(/\/$/, '') ?? ''
|
||||
const renderMarkdown = createMarkdownRenderer({ collection, content, settingsSlug })
|
||||
const renderMarkdown = createMarkdownRenderer({ baseUrl: origin || undefined, collection, config, content, settingsSlug })
|
||||
|
||||
const localeProp = { type: 'string', description: `Locale code (default ${config.defaultLocale})` }
|
||||
|
||||
@@ -117,7 +118,7 @@ export function createMcpRoute(args: CreateMcpRouteArgs) {
|
||||
{
|
||||
name: 'list_pages',
|
||||
description:
|
||||
'List all published pages of the site with title, URL and description — the table of contents. Fetch one with get_page.',
|
||||
'List all published pages and entries (e.g. blog posts) with title, URL and description — the table of contents. Fetch one with get_page.',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@@ -189,21 +190,26 @@ export function createMcpRoute(args: CreateMcpRouteArgs) {
|
||||
|
||||
async function runList(params: Record<string, unknown>): Promise<string> {
|
||||
const locale = pickLocale(params)
|
||||
const limit = typeof params.limit === 'number' ? params.limit : 50
|
||||
const limit = Math.min(Math.max(Math.trunc(typeof params.limit === 'number' ? params.limit : 50) || 50, 1), 200)
|
||||
const payload = await getCachedPayload()
|
||||
const meta = await siteMeta(payload, locale)
|
||||
const results = await listContent({
|
||||
// Same index as llms.txt and the sitemap rules: pages AND archive entries (blog…).
|
||||
const index = await collectSiteIndex({
|
||||
baseUrl: origin,
|
||||
collection,
|
||||
config,
|
||||
homeSlug: meta?.homeSlug,
|
||||
limit,
|
||||
locale,
|
||||
content,
|
||||
locales: [locale],
|
||||
pagesSlug: collection,
|
||||
payload,
|
||||
settingsSlug,
|
||||
summaryField,
|
||||
})
|
||||
if (results.length === 0) {return 'No published pages.'}
|
||||
return formatResults(results)
|
||||
if (index.length === 0) {return 'No published pages.'}
|
||||
const shown = index.slice(0, limit)
|
||||
const lines = shown.map(
|
||||
(e) => `- ${e.title} (${e.url})${e.description ? ` — ${e.description}` : ''}${e.collection === collection ? '' : ` [${e.collectionLabel}]`}`,
|
||||
)
|
||||
if (index.length > shown.length) {lines.push(`… ${index.length - shown.length} more — raise limit (max 200) or use search_content.`)}
|
||||
return lines.join('\n')
|
||||
}
|
||||
|
||||
async function runSearch(params: Record<string, unknown>): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user