SEO: favicon metadata, Organization JSON-LD, favicon validation; R2 media (preconnect, generateFileURL per-collection), filename normalization
This commit is contained in:
@@ -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',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user