Files
ipal-kit/dist/globals/SiteSettings/fields/general.js
T

96 lines
2.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { validateFaviconField } from '../../../modules/seo/index.js';
/**
* General site identity fields.
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo, favicon).
*/ export const generalFields = [
{
name: 'siteName',
type: 'text',
admin: {
description: 'Used in page titles and Open Graph metadata.'
},
localized: true,
required: 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. Also used for Organization structured data (buildOrganizationJsonLd).'
},
relationTo: 'media'
},
{
name: 'defaultShareImage',
type: 'upload',
admin: {
description: 'Fallback Open Graph image when a page has none.'
},
relationTo: 'media'
},
{
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: {
// 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'
}
];
//# sourceMappingURL=general.js.map