SEO: favicon metadata, Organization JSON-LD, favicon validation; R2 media (preconnect, generateFileURL per-collection), filename normalization

This commit is contained in:
2026-08-28 00:08:35 +02:00
parent f1f808d079
commit b9430e7ab6
25 changed files with 490 additions and 11 deletions
+12 -3
View File
@@ -1,8 +1,10 @@
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).
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo, favicon).
*/
export const generalFields: Field[] = [
{
@@ -45,7 +47,8 @@ export const generalFields: Field[] = [
name: 'logo',
type: 'upload',
admin: {
description: 'Primary site logo.',
description:
'Primary site logo. Also used for Organization structured data (buildOrganizationJsonLd).',
},
relationTo: 'media',
},
@@ -61,7 +64,13 @@ export const generalFields: Field[] = [
name: 'favicon',
type: 'upload',
admin: {
description: 'Square source icon (PNG or SVG) for the browser tab. Rendered by the frontend.',
description:
'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.',
},
hooks: {
// Warns the editor at save time if the favicon is too small (<48×48) or
// not square — Google won't display such favicons in search results.
beforeValidate: [validateFaviconField],
},
relationTo: 'media',
},