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]>
96 lines
2.7 KiB
TypeScript
96 lines
2.7 KiB
TypeScript
import type { Field } from 'payload'
|
||
|
||
import { validateFaviconField } from '../../../modules/seo/index.js'
|
||
|
||
/**
|
||
* General site identity fields.
|
||
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
|
||
*/
|
||
export const generalFields: Field[] = [
|
||
{
|
||
name: 'siteName',
|
||
type: 'text',
|
||
admin: {
|
||
description: 'Used in page titles and Open Graph metadata.',
|
||
},
|
||
localized: true,
|
||
required: true,
|
||
},
|
||
{
|
||
name: 'siteDescription',
|
||
type: 'textarea',
|
||
admin: {
|
||
description:
|
||
'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.',
|
||
},
|
||
localized: true,
|
||
},
|
||
{
|
||
name: 'titleOrder',
|
||
type: 'select',
|
||
admin: {
|
||
description: 'Which comes first in browser tabs.',
|
||
},
|
||
defaultValue: 'page-first',
|
||
options: [
|
||
{ label: 'Page first — About Us | Acme', value: 'page-first' },
|
||
{ label: 'Site first — Acme | About Us', value: 'site-first' },
|
||
],
|
||
},
|
||
{
|
||
name: 'titleSeparator',
|
||
type: 'select',
|
||
admin: {
|
||
description: 'Separates the page title from the site name in browser tabs.',
|
||
},
|
||
defaultValue: '|',
|
||
options: [
|
||
{ label: 'Pipe — Page | Site', value: '|' },
|
||
{ label: 'Dash — Page – Site', value: '–' },
|
||
{ label: 'Hyphen — Page - Site', value: '-' },
|
||
{ label: 'Bullet — Page · Site', value: '·' },
|
||
{ label: 'Slash — Page / Site', value: '/' },
|
||
],
|
||
},
|
||
{
|
||
name: 'logo',
|
||
type: 'upload',
|
||
admin: {
|
||
description: 'Primary site logo.',
|
||
},
|
||
relationTo: 'media',
|
||
},
|
||
{
|
||
name: 'defaultShareImage',
|
||
type: 'upload',
|
||
admin: {
|
||
description: 'Fallback Open Graph image when a page has none.',
|
||
},
|
||
relationTo: 'media',
|
||
},
|
||
{
|
||
name: 'sameAs',
|
||
type: 'array',
|
||
admin: {
|
||
description:
|
||
'Official profiles of this business (Google Business Profile, LinkedIn, Facebook, Wikipedia…). Tells search engines and AI which entity the site belongs to.',
|
||
initCollapsed: true,
|
||
},
|
||
fields: [{ name: 'url', type: 'text', required: true, validate: (v: unknown) => (typeof v === 'string' && /^https?:\/\/\S+$/.test(v)) || 'Full URL, e.g. https://www.linkedin.com/company/acme' }],
|
||
labels: { plural: 'Profiles', singular: 'Profile' },
|
||
},
|
||
{
|
||
name: 'favicon',
|
||
type: 'upload',
|
||
admin: {
|
||
description:
|
||
'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.',
|
||
},
|
||
hooks: {
|
||
// Warn the editor if the favicon is too small / not square for Google.
|
||
beforeValidate: [validateFaviconField],
|
||
},
|
||
relationTo: 'media',
|
||
},
|
||
]
|